|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.object.AbstractObjectFactory
org.mule.object.SingletonObjectFactory
public class SingletonObjectFactory
Creates an instance of the object once and then always returns the same instance.
| Field Summary |
|---|
| Fields inherited from class org.mule.object.AbstractObjectFactory |
|---|
ATTRIBUTE_OBJECT_CLASS, ATTRIBUTE_OBJECT_CLASS_NAME, initialisationCallbacks, logger, muleContext, 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 | |
|---|---|
SingletonObjectFactory()
For Spring only |
|
SingletonObjectFactory(Class objectClass)
|
|
SingletonObjectFactory(Class<?> objectClass,
Map properties)
|
|
SingletonObjectFactory(Object instance)
Create the singleton based on a previously created object. |
|
SingletonObjectFactory(String objectClassName)
|
|
SingletonObjectFactory(String objectClassName,
Map properties)
|
|
| Method Summary | |
|---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources. |
Object |
getInstance()
Always returns the same instance of the object. |
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 |
isSingleton()
Returns true if the ObjectFactory implementation always returns the same object instance. |
| Methods inherited from class org.mule.object.AbstractObjectFactory |
|---|
addObjectInitialisationCallback, fireInitialisationCallbacks, getObjectClassName, getProperties, isExternallyManagedLifecycle, setMuleContext, 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 SingletonObjectFactory()
public SingletonObjectFactory(String objectClassName)
public SingletonObjectFactory(String objectClassName,
Map properties)
public SingletonObjectFactory(Class objectClass)
public SingletonObjectFactory(Class<?> objectClass,
Map properties)
public SingletonObjectFactory(Object instance)
| Method Detail |
|---|
public void initialise()
throws InitialisationException
InitialisableInitialisationException 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 Initialisableinitialise in class AbstractObjectFactoryInitialisationException - 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 Disposabledispose in class AbstractObjectFactory
public Object getInstance()
throws Exception
getInstance in interface ObjectFactorygetInstance in class AbstractObjectFactoryExceptionpublic Class<?> getObjectClass()
ObjectFactory
getObjectClass in interface ObjectFactorygetObjectClass in class AbstractObjectFactorypublic boolean isSingleton()
ObjectFactory
isSingleton in interface ObjectFactoryisSingleton in class AbstractObjectFactorypublic boolean isAutoWireObject()
ObjectFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||