|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.component.AbstractComponent
public abstract class AbstractComponent
Abstract Component
to be used by all Component
implementations.
Field Summary | |
---|---|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
disposed
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
disposing
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
initialised
|
protected List |
interceptors
|
protected Log |
logger
logger used by this class |
protected MuleContext |
muleContext
|
protected ServerNotificationHandler |
notificationHandler
|
protected Service |
service
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
started
|
protected ComponentStatistics |
statistics
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
stopping
|
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 | |
---|---|
AbstractComponent()
|
Method Summary | |
---|---|
protected void |
checkDisposed()
|
protected MuleMessage |
createResultMessage(MuleEvent event,
Object result)
|
void |
dispose()
A lifecycle method where implementor should free up any resources. |
protected void |
doDispose()
|
protected void |
doInitialise()
|
protected abstract Object |
doInvoke(MuleEvent event)
|
protected void |
doStart()
|
protected void |
doStop()
|
protected void |
fireComponentNotification(MuleMessage message,
int action)
|
List |
getInterceptors()
|
Service |
getService()
|
ComponentStatistics |
getStatistics()
Component statistics are used to gather component statistics such as sync/async invocation counts and total and average execution time. |
void |
initialise()
Method used to perform any initialisation work. |
MuleMessage |
intercept(Invocation invocation)
Invoked when the component should be called. |
MuleMessage |
invoke(MuleEvent event)
Invokes the component |
void |
release()
|
void |
setInterceptors(List interceptors)
|
void |
setMuleContext(MuleContext context)
|
void |
setService(Service service)
|
void |
start()
|
void |
stop()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Log logger
protected Service service
protected ComponentStatistics statistics
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean started
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean stopping
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean initialised
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean disposing
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean disposed
protected ServerNotificationHandler notificationHandler
protected List interceptors
protected MuleContext muleContext
Constructor Detail |
---|
public AbstractComponent()
Method Detail |
---|
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public List getInterceptors()
public void setInterceptors(List interceptors)
public MuleMessage intercept(Invocation invocation) throws MuleException
Interceptor
Invocation#execute()
to call the component.
intercept
in interface Interceptor
invocation
- the invocation containing info about the current message and
service
MuleException
- if the invocation failspublic MuleMessage invoke(MuleEvent event) throws MuleException
Component
invoke
in interface Component
event
- the event used to invoke the component
MuleException
- if the call failsprotected MuleMessage createResultMessage(MuleEvent event, Object result) throws TransformerException
TransformerException
protected abstract Object doInvoke(MuleEvent event) throws Exception
Exception
public String toString()
toString
in class Object
public void release()
public ComponentStatistics getStatistics()
Component
getStatistics
in interface Component
public void setService(Service service)
setService
in interface Component
public Service getService()
getService
in interface Component
public final void initialise() throws InitialisationException
Initialisable
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.
initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered fromprotected void doInitialise() throws InitialisationException
InitialisationException
public void dispose()
Disposable
dispose
in interface Disposable
protected void doDispose()
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
protected void doStart() throws MuleException
MuleException
public void start() throws MuleException
start
in interface Startable
MuleException
protected void doStop() throws MuleException
MuleException
protected void checkDisposed() throws DisposeException
DisposeException
protected void fireComponentNotification(MuleMessage message, int action)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |