|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.impl.model.AbstractComponent
A base implementation for all UMOComponents in Mule
| Field Summary | |
protected MuleDescriptor |
descriptor
The Mule descriptor associated with the component |
protected ExceptionListener |
exceptionListener
The exception strategy used by the component, this is provided by the UMODescriptor |
protected AtomicBoolean |
initialised
Determines if the component has been initilised |
protected Log |
logger
logger used by this class |
protected UMOModel |
model
The model in which this component is registered |
protected WaitableBoolean |
paused
Determines if the component has been paused |
protected AtomicBoolean |
poolInitialised
determines if the proxy pool has been initialised |
protected ComponentStatistics |
stats
|
protected AtomicBoolean |
stopped
Determines if the component has been stopped |
protected WaitableBoolean |
stopping
Determines whether stop has been called and is still in progress |
| Constructor Summary | |
AbstractComponent(MuleDescriptor descriptor,
UMOModel model)
Default constructor |
|
| Method Summary | |
protected void |
connectListeners()
|
protected void |
disconnectListeners()
|
void |
dispatchEvent(UMOEvent event)
Makes an asynhronous event call to the component. |
void |
dispose()
A lifecycle method where implementor should free up any resources. |
protected abstract void |
doDispatch(UMOEvent event)
|
protected void |
doDispose()
|
protected void |
doForceStop()
|
protected void |
doInitialise()
|
protected void |
doPause()
Custom components can execute code necessary to put the component in a paused state here. |
protected void |
doResume()
Custom components can execute code necessary to resume a component once it has been paused If a developer overloads this method the doPause() method MUST also be overloaded to avoid inconsistent state in the component |
protected abstract UMOMessage |
doSend(UMOEvent event)
|
protected void |
doStart()
|
protected void |
doStop()
|
protected void |
fireComponentNotification(int action)
|
void |
forceStop()
|
UMODescriptor |
getDescriptor()
|
protected List |
getIncomingEndpoints()
Returns a list of all incoming endpoints on a component. |
Object |
getInstance()
Gets the underlying instance form this component Where the Component implmentation provides pooling this is no 1-2-1 mapping between UMOComponent and instance, so this method will return the object in initial state. |
String |
getName()
|
ComponentStatistics |
getStatistics()
|
protected void |
handleException(Exception e)
|
void |
initialise()
Initialise the component. |
boolean |
isPaused()
Determines if the component is in a paused state |
boolean |
isStarted()
Determines whether this component has been started |
boolean |
isStopped()
|
boolean |
isStopping()
|
protected Object |
lookupComponent()
Provides a consistent mechanism for custom models to create components. |
void |
pause()
Pauses event processing for a single Mule Component. |
protected void |
registerListeners()
|
void |
resume()
Resumes a single Mule Component that has been paused. |
UMOMessage |
sendEvent(UMOEvent event)
Makes a synhronous event call to the component. |
void |
start()
|
protected void |
start(boolean startPaused)
Starts a Mule Component. |
protected void |
startListeners()
|
void |
stop()
|
protected void |
stopListeners()
|
String |
toString()
|
protected void |
unregisterListeners()
|
protected void |
waitIfPaused(UMOEvent event)
Called before an event is sent or dispatched to a component, it will block until resume() is called. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected transient Log logger
protected MuleDescriptor descriptor
protected ComponentStatistics stats
protected AtomicBoolean stopped
protected WaitableBoolean stopping
protected AtomicBoolean poolInitialised
protected ExceptionListener exceptionListener
protected AtomicBoolean initialised
protected UMOModel model
protected WaitableBoolean paused
| Constructor Detail |
public AbstractComponent(MuleDescriptor descriptor,
UMOModel model)
| Method Detail |
public final void initialise()
throws InitialisationException
initialise in interface InitialisableInitialisationException - if the component fails
to initialiseUMODescriptorprotected void fireComponentNotification(int action)
public void forceStop()
throws UMOException
UMOException
public void stop()
throws UMOException
stop in interface StoppableUMOException
public void start()
throws UMOException
start in interface StartableUMOException
protected void start(boolean startPaused)
throws UMOException
startPaused - - Start component in a "paused" state (messages are
received but not processed).
UMOException
public final void pause()
throws UMOException
pause in interface UMOComponentUMOException
public final void resume()
throws UMOException
resume in interface UMOComponentUMOExceptionpublic boolean isPaused()
isPaused in interface UMOComponent
protected void doPause()
throws UMOException
UMOException
protected void doResume()
throws UMOException
UMOExceptionpublic final void dispose()
Disposable
dispose in interface Disposablepublic ComponentStatistics getStatistics()
public UMODescriptor getDescriptor()
getDescriptor in interface UMOComponentUMODescriptor
public void dispatchEvent(UMOEvent event)
throws UMOException
UMOComponent
dispatchEvent in interface UMOComponentevent - the event to consume
UMOException - if the event fails to be processed
public UMOMessage sendEvent(UMOEvent event)
throws UMOException
UMOComponent
sendEvent in interface UMOComponentevent - the event to consume
UMOException - if the event fails to be processed
protected void waitIfPaused(UMOEvent event)
throws InterruptedException
event - the current event being passed to the component
InterruptedException - if the thread is interruptedpublic String getName()
public String toString()
public boolean isStopped()
public boolean isStopping()
protected void handleException(Exception e)
protected Object lookupComponent()
throws UMOException
UMOException
protected void doForceStop()
throws UMOException
UMOException
protected void doStop()
throws UMOException
UMOException
protected void doStart()
throws UMOException
UMOExceptionprotected void doDispose()
protected void doInitialise()
throws InitialisationException
InitialisationExceptionpublic boolean isStarted()
UMOComponent
isStarted in interface UMOComponent
protected abstract UMOMessage doSend(UMOEvent event)
throws UMOException
UMOException
protected abstract void doDispatch(UMOEvent event)
throws UMOException
UMOException
public Object getInstance()
throws UMOException
getInstance in interface UMOComponentUMOException
protected void registerListeners()
throws UMOException
UMOException
protected void unregisterListeners()
throws UMOException
UMOException
protected void startListeners()
throws UMOException
UMOException
protected void stopListeners()
throws UMOException
UMOException
protected void connectListeners()
throws UMOException
UMOException
protected void disconnectListeners()
throws UMOException
UMOExceptionprotected List getIncomingEndpoints()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||