public class DefaultComponentLifecycleAdapter extends Object implements LifecycleAdapter
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 -
This implementation also supports JSR-250 lifecycle annotations
PostConstruct (for initialisation) and/or PreDestroy
(for disposal of the object). Only one of each annotation can be used per component object.| Modifier and Type | Field and Description |
|---|---|
protected JavaComponent |
component |
protected Object |
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 org.apache.commons.logging.Log |
logger
logger used by this class
|
protected MuleContext |
muleContext |
PHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAME| Constructor and Description |
|---|
DefaultComponentLifecycleAdapter(Object componentObject,
JavaComponent component,
FlowConstruct flowConstruct,
EntryPointResolverSet entryPointResolver,
MuleContext muleContext) |
DefaultComponentLifecycleAdapter(Object componentObject,
JavaComponent component,
FlowConstruct flowConstruct,
MuleContext muleContext) |
| Modifier and Type | Method and Description |
|---|---|
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 |
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. |
protected static final org.apache.commons.logging.Log logger
protected Object 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
public DefaultComponentLifecycleAdapter(Object componentObject, JavaComponent component, FlowConstruct flowConstruct, MuleContext muleContext) throws MuleException
MuleExceptionpublic DefaultComponentLifecycleAdapter(Object componentObject, JavaComponent component, FlowConstruct flowConstruct, EntryPointResolverSet entryPointResolver, MuleContext muleContext) throws MuleException
MuleExceptionprotected void setLifecycleFlags()
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 shutdownRecoverableException - if an error occurs that can be recovered frompublic 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 StartableMuleExceptionpublic 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 LifecycleAdapterpublic Object invoke(MuleEvent event) throws MuleException
invoke in interface LifecycleAdapterMuleExceptionCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.