org.mule.extras.spring.config
Class AutowireUMOManagerFactoryBean

java.lang.Object
  extended by org.mule.extras.spring.config.AutowireUMOManagerFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class AutowireUMOManagerFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware

UMOManagerFactoryBean is a MuleManager factory bean that is used to configure the MuleManager from a spring context. This factory bean is responsible for determining the instance type of UMOManager to create and then delegates configuration calls to that instance depending on what is available in the container.

Apart from removing the need to explicitly wire the MuleManager instance together there another advantage to using the AutowireUMOManagerFactoryBean. There is no need to declare a UMOModel instance in the configuration. If the factory doesn't find a UMOModel implementation it creates a default one of type org.mule.impl.model.seda.SedaModel. The model is automatically initialised with a SpringContainercontext using the current beanFactory and defaults are used for the other Model properties. If you want to override the defaults, such as define your own exception strategy, (which you will most likely want to do) simply declare your exception strategy bean in the container and it will automatically be set on the model.

Most Mule objects have explicit types and can be autowired, however some objects cannot be autowired, such as a java.util.Map of endpoints for example. For these objects Mule defines standard bean names that will be looked for in the container during start up.

muleEnvironmentProperties A map of properties to set on the MuleManager. Accessible from your code using AutowireUMOManagerFactoryBean.MULE_ENVIRONMENT_PROPERTIES_BEAN_NAME.

muleEndpointMappings A Map of logical endpointUri mappings accessible from your code using AutowireUMOManagerFactoryBean.MULE_ENDPOINT_MAPPINGS_BEAN_NAME.

muleInterceptorStacks A map of interceptor stacks, where the name of the stack is the key and a list of interceptors is the value. Accessible using from your code using AutowireUMOManagerFactoryBean.MULE_INTERCEPTOR_STACK_BEAN_NAME.


Field Summary
protected static Log logger
          logger used by this class
static String MULE_ENDPOINT_IDENTIFIERS_BEAN_NAME
           
static String MULE_ENVIRONMENT_PROPERTIES_BEAN_NAME
           
static String MULE_INTERCEPTOR_STACK_BEAN_NAME
           
static String MULE_MODEL_EXCEPTION_STRATEGY_BEAN_NAME
           
 
Constructor Summary
AutowireUMOManagerFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void createModel()
           
 void destroy()
           
 Object getObject()
           
 Class getObjectType()
           
 boolean isSingleton()
           
protected  void setAgents(Collection agents)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
protected  void setComponents(Collection components)
           
protected  void setConnectors(Collection connectors)
           
protected  void setContainerContext(Map containers)
           
protected  void setEndpoints(Collection endpoints)
           
protected  void setInterceptorStacks(Map stacks)
           
 void setManagerId(String managerId)
           
protected  void setMessageEndpointIdentifiers(Map endpoints)
           
protected  void setProperties(Map props)
           
protected  void setTransformers(Collection transformers)
           
 
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


MULE_ENVIRONMENT_PROPERTIES_BEAN_NAME

public static final String MULE_ENVIRONMENT_PROPERTIES_BEAN_NAME
See Also:
Constant Field Values

MULE_ENDPOINT_IDENTIFIERS_BEAN_NAME

public static final String MULE_ENDPOINT_IDENTIFIERS_BEAN_NAME
See Also:
Constant Field Values

MULE_INTERCEPTOR_STACK_BEAN_NAME

public static final String MULE_INTERCEPTOR_STACK_BEAN_NAME
See Also:
Constant Field Values

MULE_MODEL_EXCEPTION_STRATEGY_BEAN_NAME

public static final String MULE_MODEL_EXCEPTION_STRATEGY_BEAN_NAME
See Also:
Constant Field Values
Constructor Detail

AutowireUMOManagerFactoryBean

public AutowireUMOManagerFactoryBean()
                              throws Exception
Throws:
Exception
Method Detail

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
Throws:
Exception

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

setManagerId

public void setManagerId(String managerId)

createModel

protected void createModel()
                    throws UMOException
Throws:
UMOException

setContainerContext

protected void setContainerContext(Map containers)
                            throws UMOException
Throws:
UMOException

setMessageEndpointIdentifiers

protected void setMessageEndpointIdentifiers(Map endpoints)
                                      throws InitialisationException
Throws:
InitialisationException

setAgents

protected void setAgents(Collection agents)
                  throws UMOException
Throws:
UMOException

setProperties

protected void setProperties(Map props)

setConnectors

protected void setConnectors(Collection connectors)
                      throws UMOException
Throws:
UMOException

setTransformers

protected void setTransformers(Collection transformers)
                        throws InitialisationException
Throws:
InitialisationException

setEndpoints

protected void setEndpoints(Collection endpoints)
                     throws InitialisationException
Throws:
InitialisationException

setComponents

protected void setComponents(Collection components)
                      throws UMOException
Throws:
UMOException

setInterceptorStacks

protected void setInterceptorStacks(Map stacks)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception


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