|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.object.AbstractObjectFactory
org.mule.config.spring.util.SpringBeanLookup
public class SpringBeanLookup
This is an implementation of the ObjectFactory interface which simply delegates to
the Spring ApplicationContext. Since the delegation happens each time a call to
getOrCreate() is made, this will correctly handle Spring beans which are
non-singletons (factory beans, etc.)
Singleton usage:
Field Summary |
---|
Fields inherited from class org.mule.object.AbstractObjectFactory |
---|
ATTRIBUTE_OBJECT_CLASS, ATTRIBUTE_OBJECT_CLASS_NAME, disposed, flowConstruct, initialisationCallbacks, logger, objectClass, objectClassName, properties |
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
SpringBeanLookup()
|
Method Summary | |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources. |
String |
getBean()
|
Object |
getInstance(MuleContext muleContext)
Creates an initialized object instance based on the class and sets any properties. |
Class<?> |
getObjectClass()
Returns the class of the object to be instantiated without actually creating an instance. |
void |
initialise()
Method used to perform any initialisation work. |
boolean |
isAutoWireObject()
Return true if the created object should get its dependencies wired from the registry automatically. |
boolean |
isExternallyManagedLifecycle()
Returns true if Mule should not manage the life-cycle the object instance returned from the ObjectFactory. |
boolean |
isSingleton()
Returns true if the ObjectFactory implementation always returns the same object instance. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setBean(String bean)
|
Methods inherited from class org.mule.object.AbstractObjectFactory |
---|
addObjectInitialisationCallback, fireInitialisationCallbacks, getObjectClassName, getProperties, setFlowConstruct, setObjectClass, setObjectClassName, setProperties, setupObjectClassFromObjectClassName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpringBeanLookup()
Method Detail |
---|
public void initialise() throws InitialisationException
Initialisable
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.
initialise
in interface Initialisable
initialise
in class AbstractObjectFactory
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered frompublic void dispose()
Disposable
dispose
in interface Disposable
dispose
in class AbstractObjectFactory
public Class<?> getObjectClass()
ObjectFactory
getObjectClass
in interface ObjectFactory
getObjectClass
in class AbstractObjectFactory
public Object getInstance(MuleContext muleContext) throws Exception
AbstractObjectFactory
getInstance
in interface ObjectFactory
getInstance
in class AbstractObjectFactory
muleContext
- the current MuleContext
instance. This can be used for performing registry lookups
applying processors to newly created objects or even firing custom notifications
Exception
- Can throw any type of exception while creating a new objectpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public String getBean()
public void setBean(String bean)
public boolean isSingleton()
ObjectFactory
isSingleton
in interface ObjectFactory
isSingleton
in class AbstractObjectFactory
public boolean isExternallyManagedLifecycle()
ObjectFactory
isExternallyManagedLifecycle
in interface ObjectFactory
isExternallyManagedLifecycle
in class AbstractObjectFactory
public boolean isAutoWireObject()
ObjectFactory
isAutoWireObject
in interface ObjectFactory
isAutoWireObject
in class AbstractObjectFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |