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 -
InitialisableStartableStoppableDisposablePostConstruct (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.slf4j.Logger |
logger
logger used by this class
|
protected MuleContext |
muleContext |
| 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(Event event,
Event.Builder eventBuilder) |
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.slf4j.Logger 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 org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic DefaultComponentLifecycleAdapter(Object componentObject, JavaComponent component, FlowConstruct flowConstruct, EntryPointResolverSet entryPointResolver, MuleContext muleContext) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionprotected void setLifecycleFlags()
public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
Initialisable
interface.
NOTE: It is up to component implementations to ensure their implementation of initialise() is
thread-safe.initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
throws org.mule.runtime.api.exception.MuleException
Startable interface.
NOT: It is up to component implementations to ensure their implementation of start() is thread-safe.start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
Stoppable interface. NOT:
It is up to component implementations to ensure their implementation of stop() is thread-safe.stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionpublic void dispose()
Disposable interface.
NOT: It is up to component implementations to ensure their implementation of dispose() is thread-safe.dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic boolean isStarted()
isStarted in interface LifecycleAdapterpublic boolean isDisposed()
isDisposed in interface LifecycleAdapterpublic Object invoke(Event event, Event.Builder eventBuilder) throws org.mule.runtime.api.exception.MuleException
invoke in interface LifecycleAdapterorg.mule.runtime.api.exception.MuleExceptionCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.