org.mule.impl.container
Class AbstractContainerContext

java.lang.Object
  extended byorg.mule.impl.container.AbstractContainerContext
All Implemented Interfaces:
Disposable, Initialisable, UMOContainerContext
Direct Known Subclasses:
DescriptorContainerContext, HiveMindContext, JndiContainerContext, MuleContainerContext, PicoContainerContext, PropertiesContainerContext, SpringContainerContext

public abstract class AbstractContainerContext
extends Object
implements UMOContainerContext

AbstractContainerContext provides base container configuration functions for handling embedded configuration.


Field Summary
protected  Log logger
          logger used by this class
 
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.
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 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.umo.manager.UMOContainerContext
getComponent
 

Field Detail

logger

protected transient Log logger
logger used by this class

Constructor Detail

AbstractContainerContext

protected AbstractContainerContext(String name)
Method Detail

getName

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

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

setName

public void setName(String name)
Description copied from interface: UMOContainerContext
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 UMOContainerContext
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

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: UMOContainerContext
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 UMOContainerContext
Parameters:
configuration -
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()

configure

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


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