org.mule.container
Class MultiContainerContext

java.lang.Object
  extended by org.mule.container.MultiContainerContext
All Implemented Interfaces:
ContainerContext, Disposable, Initialisable

public class MultiContainerContext
extends Object
implements ContainerContext

MultiContainerContext is a container that hosts other containers from which components are queried.


Field Summary
protected static Log logger
          logger used by this class
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
MultiContainerContext()
           
 
Method Summary
 void addContainer(ContainerContext container)
           
 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.
 Object getComponent(Object key)
          Queries a service from the underlying container
 String getName()
          Gets the identifying name of the container
 void initialise()
          Method used to perform any initialisation work.
 ContainerContext removeContainer(String name)
           
 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
 

Field Detail

logger

protected static final Log logger
logger used by this class

Constructor Detail

MultiContainerContext

public MultiContainerContext()
Method Detail

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

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

addContainer

public void addContainer(ContainerContext container)

removeContainer

public ContainerContext removeContainer(String name)

getComponent

public Object getComponent(Object key)
                    throws ObjectNotFoundException
Description copied from interface: ContainerContext
Queries a service from the underlying container

Specified by:
getComponent in interface ContainerContext
Parameters:
key - the key fo find the service with. Its up to the individual implementation to check the type of this key and look up objects accordingly
Returns:
The service found in the container
Throws:
ObjectNotFoundException - if the service is not found

configure

public 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

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

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


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