org.mule.impl.container
Class AbstractContainerContext

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

public abstract class AbstractContainerContext
extends java.lang.Object
implements UMOContainerContext

AbstractContainerContext provides base container configuration functions for handling embedded configuration

Version:
$Revision: 1.2 $
Author:
Ross Mason

Field Summary
static java.lang.String DEFAULT_ENCODING
           
protected  Log logger
          logger used by this class
 
Constructor Summary
protected AbstractContainerContext(java.lang.String name)
           
 
Method Summary
abstract  void configure(java.io.Reader configuration)
           
 void configure(java.io.Reader configuration, java.lang.String doctype, java.lang.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 fee up any resources If an exception is thrown it should just be logged and processing should continue.
protected  java.lang.String getDefaultDocType()
           
protected  java.lang.String getDefaultEncoding()
           
 java.lang.String getName()
          Gets the identifying name of the container
protected  java.lang.String getXmlDeclaration(java.lang.String encoding)
           
 void initialise()
          Method used to perform any initialisation work.
 void setName(java.lang.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


DEFAULT_ENCODING

public static final java.lang.String DEFAULT_ENCODING
See Also:
Constant Field Values
Constructor Detail

AbstractContainerContext

protected AbstractContainerContext(java.lang.String name)
Method Detail

getName

public java.lang.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(java.lang.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,
                       RecoverableException
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

dispose

public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should fee 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(java.io.Reader configuration,
                            java.lang.String doctype,
                            java.lang.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 java.lang.String getXmlDeclaration(java.lang.String encoding)

getDefaultDocType

protected java.lang.String getDefaultDocType()

getDefaultEncoding

protected java.lang.String getDefaultEncoding()

configure

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


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.