public abstract class AbstractComponent extends Object implements Component
Modifier and Type | Field and Description |
---|---|
protected AtomicBoolean |
disposed |
protected AtomicBoolean |
disposing |
protected AtomicBoolean |
initialised |
protected org.apache.commons.logging.Log |
logger
logger used by this class
|
protected ServerNotificationHandler |
notificationHandler |
protected Service |
service |
protected AtomicBoolean |
started |
protected ComponentStatistics |
statistics |
protected AtomicBoolean |
stopping |
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
AbstractComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDisposed() |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected void |
doDispose() |
protected void |
doInitialise() |
protected abstract MuleMessage |
doOnCall(MuleEvent event) |
protected void |
doStart() |
protected void |
doStop() |
protected void |
fireComponentNotification(MuleMessage message,
int action) |
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 |
onCall(MuleEvent event)
Invokes the component
|
void |
release() |
void |
setService(Service service) |
void |
start() |
void |
stop() |
String |
toString() |
protected final org.apache.commons.logging.Log logger
protected Service service
protected ComponentStatistics statistics
protected final AtomicBoolean started
protected final AtomicBoolean stopping
protected final AtomicBoolean initialised
protected final AtomicBoolean disposing
protected final AtomicBoolean disposed
protected ServerNotificationHandler notificationHandler
public MuleMessage onCall(MuleEvent event) throws MuleException
Component
onCall
in interface Component
event
- the event used to invoke the componentMuleException
- if the call failsprotected abstract MuleMessage doOnCall(MuleEvent event) throws Exception
Exception
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 shutdownRecoverableException
- 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)
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.