org.mule.component
Class AbstractComponent
java.lang.Object
org.mule.component.AbstractComponent
- All Implemented Interfaces:
- Component, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, MessageProcessor
- Direct Known Subclasses:
- AbstractJavaComponent, AbstractWebServiceWrapperComponent, JerseyResourcesComponent, PassThroughComponent, ProcessComponent, RestServiceWrapper, ScriptComponent
public abstract class AbstractComponent
- extends Object
- implements Component, MuleContextAware, Lifecycle
Abstract Component
to be used by all Component
implementations.
logger
protected final Log logger
- logger used by this class
flowConstruct
protected FlowConstruct flowConstruct
statistics
protected ComponentStatistics statistics
notificationHandler
protected ServerNotificationHandler notificationHandler
interceptors
protected List<Interceptor> interceptors
interceptorChain
protected MessageProcessorChain interceptorChain
muleContext
protected MuleContext muleContext
lifecycleManager
protected ComponentLifecycleManager lifecycleManager
AbstractComponent
public AbstractComponent()
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext
in interface MuleContextAware
getInterceptors
public List<Interceptor> getInterceptors()
setInterceptors
public void setInterceptors(List<Interceptor> interceptors)
process
public MuleEvent process(MuleEvent event)
throws MuleException
- Description copied from interface:
MessageProcessor
- Invokes the MessageProcessor.
- Specified by:
process
in interface MessageProcessor
- Parameters:
event
- MuleEvent to be processed
- Returns:
- optional response MuleEvent
- Throws:
MuleException
createResultEvent
protected MuleEvent createResultEvent(MuleEvent event,
Object result)
throws MuleException
- Throws:
MuleException
doInvoke
protected abstract Object doInvoke(MuleEvent event)
throws Exception
- Throws:
Exception
toString
public String toString()
- Overrides:
toString
in class Object
release
public void release()
getStatistics
public ComponentStatistics getStatistics()
- Description copied from interface:
Component
- Component statistics are used to gather component statistics such as
sync/async invocation counts and total and average execution time.
- Specified by:
getStatistics
in interface Component
setFlowConstruct
public void setFlowConstruct(FlowConstruct flowConstruct)
- Specified by:
setFlowConstruct
in interface FlowConstructAware
getFlowConstruct
public FlowConstruct getFlowConstruct()
initialise
public final void initialise()
throws InitialisationException
- Description copied from interface:
Initialisable
- Method used to perform any initialisation work. If a fatal error occurs during
initialisation an
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.
- Specified by:
initialise
in interface Initialisable
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
doInitialise
protected void doInitialise()
throws InitialisationException
- Throws:
InitialisationException
dispose
public void dispose()
- Description copied from interface:
Disposable
- A lifecycle method where implementor should free up any resources. If an
exception is thrown it should just be logged and processing should continue.
This method should not throw Runtime exceptions.
- Specified by:
dispose
in interface Disposable
doDispose
protected void doDispose()
stop
public void stop()
throws MuleException
- Specified by:
stop
in interface Stoppable
- Throws:
MuleException
doStart
protected void doStart()
throws MuleException
- Throws:
MuleException
start
public void start()
throws MuleException
- Specified by:
start
in interface Startable
- Throws:
MuleException
doStop
protected void doStop()
throws MuleException
- Throws:
MuleException
fireComponentNotification
protected void fireComponentNotification(MuleMessage message,
int action)
getName
protected String getName()
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.