org.mule.extras.spring
Class SpringContainerContext

java.lang.Object
  extended byorg.mule.impl.container.AbstractContainerContext
      extended byorg.mule.extras.spring.SpringContainerContext
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, Disposable, Initialisable, UMOContainerContext

public class SpringContainerContext
extends AbstractContainerContext
implements org.springframework.beans.factory.BeanFactoryAware

SpringContainerContext is a Spring Context that can expose spring-managed components for use in the Mule framework.


Field Summary
protected  org.springframework.beans.factory.BeanFactory beanFactory
          the application context to use when resolving components
protected  String configResources
          One or more Spring XML config files
protected  String configXml
          The Spring XML itself
protected  org.springframework.beans.factory.BeanFactory externalBeanFactory
           
static String SPRING_DOCTYPE_REF
           
 
Fields inherited from class org.mule.impl.container.AbstractContainerContext
logger
 
Constructor Summary
SpringContainerContext()
           
 
Method Summary
 void configure(Reader reader)
           
 void dispose()
          A lifecycle method where implementor should free up any resources.
 org.springframework.beans.factory.BeanFactory getBeanFactory()
          The spring application context used to build components
 Object getComponent(Object key)
          Queries a component from the underlying container
 String getConfigFile()
          Deprecated. use getConfigResources() instead
 String getConfigResources()
          One or more Spring XML config files
 String getConfiguration()
          Deprecated. use getConfigXml() instead
 String getConfigXml()
          The Spring XML itself
 void initialise()
          Method used to perform any initialisation work.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
          Sets the spring application context used to build components
 void setConfigFile(String configFile)
          Deprecated. use setConfigResources() instead
 void setConfigResources(String configResources)
          One or more Spring XML config files
 void setConfiguration(String configuration)
          Deprecated. use setConfigXml() instead
 void setConfigXml(String configXml)
          The Spring XML itself
 void setExternalBeanFactory(org.springframework.beans.factory.BeanFactory factory)
           
 
Methods inherited from class org.mule.impl.container.AbstractContainerContext
configure, getDefaultDocType, getDefaultEncoding, getName, getXmlDeclaration, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPRING_DOCTYPE_REF

public static final String SPRING_DOCTYPE_REF
See Also:
Constant Field Values

beanFactory

protected org.springframework.beans.factory.BeanFactory beanFactory
the application context to use when resolving components


externalBeanFactory

protected org.springframework.beans.factory.BeanFactory externalBeanFactory

configResources

protected String configResources
One or more Spring XML config files


configXml

protected String configXml
The Spring XML itself

Constructor Detail

SpringContainerContext

public SpringContainerContext()
Method Detail

getComponent

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

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

configure

public void configure(Reader reader)
               throws ContainerException
Specified by:
configure in class AbstractContainerContext
Throws:
ContainerException

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
Overrides:
initialise in class AbstractContainerContext
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
Overrides:
dispose in class AbstractContainerContext

getBeanFactory

public org.springframework.beans.factory.BeanFactory getBeanFactory()
The spring application context used to build components

Returns:
spring application context

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Sets the spring application context used to build components

Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Parameters:
beanFactory - the context to use

setExternalBeanFactory

public void setExternalBeanFactory(org.springframework.beans.factory.BeanFactory factory)

getConfigXml

public String getConfigXml()
The Spring XML itself


setConfigXml

public void setConfigXml(String configXml)
The Spring XML itself


getConfiguration

public String getConfiguration()
Deprecated. use getConfigXml() instead

The Spring XML itself.


setConfiguration

public void setConfiguration(String configuration)
Deprecated. use setConfigXml() instead

The Spring XML itself.


getConfigResources

public String getConfigResources()
One or more Spring XML config files


setConfigResources

public void setConfigResources(String configResources)
One or more Spring XML config files


getConfigFile

public String getConfigFile()
Deprecated. use getConfigResources() instead


setConfigFile

public void setConfigFile(String configFile)
                   throws ConfigurationException
Deprecated. use setConfigResources() instead

Throws:
ConfigurationException


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