public abstract class AbstractObjectFactory extends org.mule.runtime.api.meta.AbstractAnnotatedObject implements ObjectFactory, FlowConstructAware
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_OBJECT_CLASS |
static String |
ATTRIBUTE_OBJECT_CLASS_NAME |
protected boolean |
disposed |
protected FlowConstruct |
flowConstruct |
protected List<InitialisationCallback> |
initialisationCallbacks |
protected org.slf4j.Logger |
logger |
protected Class<?> |
objectClass |
protected String |
objectClassName |
protected Map |
properties |
| Constructor and Description |
|---|
AbstractObjectFactory()
For Spring only
|
AbstractObjectFactory(Class<?> objectClass) |
AbstractObjectFactory(Class<?> objectClass,
Map properties) |
AbstractObjectFactory(String objectClassName) |
AbstractObjectFactory(String objectClassName,
Map properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObjectInitialisationCallback(InitialisationCallback callback)
Register a custom initialiser
|
void |
dispose() |
protected void |
fireInitialisationCallbacks(Object component) |
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.
|
protected String |
getObjectClassName() |
protected Map |
getProperties() |
void |
initialise() |
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 |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setObjectClass(Class<?> objectClass) |
void |
setObjectClassName(String objectClassName) |
void |
setProperties(Map properties) |
protected Class<?> |
setupObjectClassFromObjectClassName() |
public static final String ATTRIBUTE_OBJECT_CLASS_NAME
public static final String ATTRIBUTE_OBJECT_CLASS
protected String objectClassName
protected Class<?> objectClass
protected Map properties
protected List<InitialisationCallback> initialisationCallbacks
protected FlowConstruct flowConstruct
protected boolean disposed
protected transient org.slf4j.Logger logger
public AbstractObjectFactory()
public AbstractObjectFactory(String objectClassName)
public AbstractObjectFactory(Class<?> objectClass)
protected Class<?> setupObjectClassFromObjectClassName()
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct in interface FlowConstructAwarepublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic Object getInstance(MuleContext muleContext) throws Exception
getInstance in interface ObjectFactorymuleContext - the current MuleContext instance. This can be used for performing
registry lookups applying processors to newly created objects or even firing custom notificationsException - Can throw any type of exception while creating a new objectprotected void fireInitialisationCallbacks(Object component) throws org.mule.runtime.api.lifecycle.InitialisationException
org.mule.runtime.api.lifecycle.InitialisationExceptionpublic Class<?> getObjectClass()
ObjectFactorygetObjectClass in interface ObjectFactorypublic void setObjectClass(Class<?> objectClass)
protected String getObjectClassName()
public void setObjectClassName(String objectClassName)
protected Map getProperties()
public void setProperties(Map properties)
public void addObjectInitialisationCallback(InitialisationCallback callback)
ObjectFactoryaddObjectInitialisationCallback in interface ObjectFactorypublic boolean isSingleton()
ObjectFactoryisSingleton in interface ObjectFactorypublic boolean isExternallyManagedLifecycle()
ObjectFactoryisExternallyManagedLifecycle in interface ObjectFactorypublic boolean isAutoWireObject()
ObjectFactoryisAutoWireObject in interface ObjectFactoryCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.