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 Log |
logger
logger used by this class
|
protected MuleContext |
muleContext |
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_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 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
MuleException
public DefaultComponentLifecycleAdapter(Object componentObject, JavaComponent component, FlowConstruct flowConstruct, EntryPointResolverSet entryPointResolver, MuleContext muleContext) throws MuleException
MuleException
protected 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 Initialisable
InitialisationException
- 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 Startable
MuleException
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 Stoppable
MuleException
public void dispose()
Disposable
interface. NOT: It is up to component
implementations to ensure their implementation of dispose() is thread-safe.dispose
in interface Disposable
public boolean isStarted()
isStarted
in interface LifecycleAdapter
public boolean isDisposed()
isDisposed
in interface LifecycleAdapter
public Object invoke(MuleEvent event) throws MuleException
invoke
in interface LifecycleAdapter
MuleException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.