|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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, 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 |
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, setObjectClass, setObjectClassName, setProperties |
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
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 Object getInstance() throws Exception
getInstance
in interface ObjectFactory
getInstance
in class AbstractObjectFactory
Exception
public Class getObjectClass()
ObjectFactory
getObjectClass
in interface ObjectFactory
getObjectClass
in class AbstractObjectFactory
public boolean isSingleton()
ObjectFactory
isSingleton
in interface ObjectFactory
isSingleton
in class AbstractObjectFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |