org.mule.container
Class AbstractContainerContext

java.lang.Object
  extended by org.mule.container.AbstractContainerContext
All Implemented Interfaces:
ContainerContext, MuleContextAware, Disposable, Initialisable
Direct Known Subclasses:
JndiContainerContext, MuleContainerContext, PropertiesContainerContext

public abstract class AbstractContainerContext
extends Object
implements ContainerContext, MuleContextAware

AbstractContainerContext provides base container configuration functions for handling embedded configuration.


Field Summary
protected  Log logger
          logger used by this class
protected  MuleContext muleContext
           
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
protected AbstractContainerContext(String name)
           
 
Method Summary
abstract  void configure(Reader configuration)
           
 void configure(Reader configuration, String doctype, String encoding)
          This method will be called if there is a configuration fragement for the container to use to configure itself.
 void dispose()
          A lifecycle method where implementor should free up any resources.
 void doInitialise(MuleContext muleContext)
           
protected  String getDefaultDocType()
           
protected  String getDefaultEncoding()
           
 String getName()
          Gets the identifying name of the container
protected  String getXmlDeclaration(String encoding)
           
 void initialise()
          Method used to perform any initialisation work.
 void setMuleContext(MuleContext context)
           
 void setName(String name)
          The identifying name of the container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.api.context.ContainerContext
getComponent
 

Field Detail

logger

protected transient Log logger
logger used by this class


muleContext

protected MuleContext muleContext
Constructor Detail

AbstractContainerContext

protected AbstractContainerContext(String name)
Method Detail

getName

public String getName()
Description copied from interface: ContainerContext
Gets the identifying name of the container

Specified by:
getName in interface ContainerContext
Returns:
the identifying name of the container

setName

public void setName(String name)
Description copied from interface: ContainerContext
The identifying name of the container. Note that implementations should provide a default name that users can choose to override The name can be used to reference a container when more than one is registered

Specified by:
setName in interface ContainerContext
Parameters:
name - the identifying name of the container

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

doInitialise

public final void doInitialise(MuleContext muleContext)
                        throws InitialisationException
Throws:
InitialisationException

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable

configure

public final void configure(Reader configuration,
                            String doctype,
                            String encoding)
                     throws ContainerException
Description copied from interface: ContainerContext
This method will be called if there is a configuration fragement for the container to use to configure itself. In Mule Xml the fragment is Xml that is embedded in the <configuration> element of the <container-context$gt; element.

Specified by:
configure in interface ContainerContext
doctype - the doctype declaration to use for the configuration fragment. can be null if no validation is to be performed or the fragment is not Xml
encoding - the encoding to use in the Xml declaration. Default is UTF-8
Throws:
ContainerException

getXmlDeclaration

protected String getXmlDeclaration(String encoding)

getDefaultDocType

protected String getDefaultDocType()

getDefaultEncoding

protected String getDefaultEncoding()

setMuleContext

public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware

configure

public abstract void configure(Reader configuration)
                        throws ContainerException
Throws:
ContainerException


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.