org.mule.extras.spring
Class SpringContainerContext

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

public class SpringContainerContext
extends AbstractContainerContext

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

Version:
$Revision: 1.7 $
Author:
Ross Mason

Field Summary
protected  BeanFactory beanFactory
          the application contect to use when resolving components
protected  java.lang.String configFile
           
protected  BeanFactory externalBeanFactory
           
protected static Log logger
          logger used by this class
static java.lang.String SPRING_DOCTYPE_REF
           
 
Fields inherited from class org.mule.impl.container.AbstractContainerContext
DEFAULT_ENCODING
 
Constructor Summary
SpringContainerContext()
           
 
Method Summary
 void configure(java.io.Reader configuration)
           
 BeanFactory getBeanFactory()
          The spring application context used to build components
 java.lang.Object getComponent(java.lang.Object key)
          Queries a component from the underlying container
 java.lang.String getConfigFile()
           
protected  java.lang.String getDefaultDocType()
           
 void initialise()
          Method used to perform any initialisation work.
 void setBeanFactory(BeanFactory beanFactory)
          Sets the spring application context used to build components
 void setConfigFile(java.lang.String configFile)
           
 void setExternalBeanFactory(BeanFactory factory)
           
 
Methods inherited from class org.mule.impl.container.AbstractContainerContext
configure, dispose, 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 java.lang.String SPRING_DOCTYPE_REF
See Also:
Constant Field Values

logger

protected static transient Log logger
logger used by this class


beanFactory

protected BeanFactory beanFactory
the application contect to use when resolving components


externalBeanFactory

protected BeanFactory externalBeanFactory

configFile

protected java.lang.String configFile
Constructor Detail

SpringContainerContext

public SpringContainerContext()
Method Detail

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Sets the spring application context used to build components

Parameters:
beanFactory - the context to use

setExternalBeanFactory

public void setExternalBeanFactory(BeanFactory factory)

getBeanFactory

public BeanFactory getBeanFactory()
The spring application context used to build components

Returns:
spring application context

getComponent

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

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

getConfigFile

public java.lang.String getConfigFile()

setConfigFile

public void setConfigFile(java.lang.String configFile)
                   throws ConfigurationException
Parameters:
configFile - The configFile to set.
Throws:
ConfigurationException

configure

public void configure(java.io.Reader configuration)
               throws ContainerException
Specified by:
configure in class AbstractContainerContext
Throws:
ContainerException

getDefaultDocType

protected java.lang.String getDefaultDocType()
Overrides:
getDefaultDocType in class AbstractContainerContext

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
Overrides:
initialise in class AbstractContainerContext
Throws:
InitialisationException
RecoverableException


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