|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mule.component.DefaultComponentLifecycleAdapter
public class DefaultComponentLifecycleAdapter
DefaultComponentLifecycleAdapter is a default implementation of
LifecycleAdapter for use with JavaComponent that expects component
instances to implement Mule lifecycle interfaces in order to receive lifecycle. Lifecycle interfaces supported are -
PostConstruct (for initialisation) and/or PreDestroy
(for disposal of the object). Only one of each annotation can be used per component object.
for details about the rules for using JSR-250 lifecycle annotations| Field Summary | |
|---|---|
protected JavaComponent |
component
|
protected SoftReference<?> |
componentObject
|
protected Method |
disposeMethod
|
protected EntryPointResolverSet |
entryPointResolver
|
protected FlowConstruct |
flowConstruct
|
protected Method |
initMethod
|
protected boolean |
isDisposable
|
protected boolean |
isInitialisable
|
protected boolean |
isStartable
|
protected boolean |
isStoppable
|
protected static Log |
logger
logger used by this class |
protected MuleContext |
muleContext
|
| Fields inherited from interface org.mule.api.lifecycle.Initialisable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Startable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Stoppable |
|---|
PHASE_NAME |
| Fields inherited from interface org.mule.api.lifecycle.Disposable |
|---|
PHASE_NAME |
| Constructor Summary | |
|---|---|
DefaultComponentLifecycleAdapter(Object componentObject,
JavaComponent component,
FlowConstruct flowConstruct,
EntryPointResolverSet entryPointResolver,
MuleContext muleContext)
|
|
DefaultComponentLifecycleAdapter(Object componentObject,
JavaComponent component,
FlowConstruct flowConstruct,
MuleContext muleContext)
|
|
| Method Summary | |
|---|---|
protected void |
configureBinding()
|
protected String |
createRegistryHardRefName(Object object)
Generate a registry key name for this component. |
void |
dispose()
Propagates dispose() life-cycle to component object implementations if they implement the mule Disposable interface. |
protected Method |
findDisposeMethod(Object object)
|
protected Method |
findInitMethod(Object object)
|
void |
initialise()
Propagates initialise() life-cycle to component object implementations if they implement the mule Initialisable interface. |
Object |
invoke(MuleEvent event)
|
boolean |
isDisposed()
|
boolean |
isStarted()
|
protected void |
registerComponentIfNecessary()
|
protected void |
setLifecycleFlags()
|
void |
start()
Propagates start() life-cycle to component object implementations if they implement the mule Startable interface. |
void |
stop()
Propagates stop() life-cycle to component object implementations if they implement the mule Stoppable interface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Log logger
protected SoftReference<?> componentObject
protected JavaComponent component
protected EntryPointResolverSet entryPointResolver
protected FlowConstruct flowConstruct
protected boolean isInitialisable
protected boolean isStartable
protected boolean isStoppable
protected boolean isDisposable
protected Method initMethod
protected Method disposeMethod
protected MuleContext muleContext
| Constructor Detail |
|---|
public DefaultComponentLifecycleAdapter(Object componentObject,
JavaComponent component,
FlowConstruct flowConstruct,
MuleContext muleContext)
throws MuleException
MuleException
public DefaultComponentLifecycleAdapter(Object componentObject,
JavaComponent component,
FlowConstruct flowConstruct,
EntryPointResolverSet entryPointResolver,
MuleContext muleContext)
throws MuleException
MuleException| Method Detail |
|---|
protected void setLifecycleFlags()
protected Method findInitMethod(Object object)
protected Method findDisposeMethod(Object object)
protected void registerComponentIfNecessary()
throws RegistrationException
RegistrationException
public void initialise()
throws InitialisationException
Initialisable interface.
NOTE: It is up to component implementations to ensure their implementation of
initialise() is thread-safe.
initialise in interface InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from
public void start()
throws MuleException
Startable interface. NOT: It is up to component
implementations to ensure their implementation of start() is thread-safe.
start in interface StartableMuleException
public void stop()
throws MuleException
Stoppable interface. NOT: It is up to component
implementations to ensure their implementation of stop() is thread-safe.
stop in interface StoppableMuleExceptionpublic void dispose()
Disposable interface. NOT: It is up to component
implementations to ensure their implementation of dispose() is thread-safe.
dispose in interface Disposablepublic boolean isStarted()
isStarted in interface LifecycleAdapterpublic boolean isDisposed()
isDisposed in interface LifecycleAdapter
public Object invoke(MuleEvent event)
throws MuleException
invoke in interface LifecycleAdapterMuleException
protected void configureBinding()
throws MuleException
MuleExceptionprotected String createRegistryHardRefName(Object object)
object - the object to associate to the generated reference name
"_component.hardref." + flowConstruct.getName() + "." + System.identityHashCode(object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||