public class SingletonObjectFactory extends AbstractObjectFactory
ATTRIBUTE_OBJECT_CLASS, ATTRIBUTE_OBJECT_CLASS_NAME, initialisationCallbacks, logger, objectClass, objectClassName, properties
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
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.
|
addObjectInitialisationCallback, fireInitialisationCallbacks, getObjectClassName, getProperties, setObjectClass, setObjectClassName, setProperties
public SingletonObjectFactory()
public SingletonObjectFactory(String objectClassName)
public SingletonObjectFactory(Class objectClass)
public SingletonObjectFactory(Object instance)
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 shutdownRecoverableException
- 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
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.