|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle
public abstract class AbstractThreadedManagedLifecycle
This class provides threaded support for a managed instance.
| Field Summary |
|---|
| Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle |
|---|
PARAM_TERMINATION_PERIOD |
| Constructor Summary | |
|---|---|
protected |
AbstractThreadedManagedLifecycle(ConfigTree config)
Construct the threaded managed lifecycle. |
| Method Summary | |
|---|---|
void |
addManagedLifecycleThreadEventListener(ManagedLifecycleThreadEventListener listener)
Add a managed lifecycle thread event listener. |
protected void |
doDestroy()
Handle the destroy of the managed instance. |
protected abstract void |
doRun()
Execute on the thread. |
protected void |
doStart()
Handle the start of the managed instance. |
protected void |
doStop()
Handle the stop of the managed instance. |
protected void |
doThreadedDestroy()
Handle the threaded destroy of the managed instance. |
boolean |
isRunning()
Is the associated thread still running? |
boolean |
isStopped()
Is the associated thread stopped? |
boolean |
isStopping()
Is the associated thread stopping? |
void |
removeManagedLifecycleThreadEventListener(ManagedLifecycleThreadEventListener listener)
Remove a managed lifecycle thread event listener. |
void |
run()
The thread execution method. |
protected void |
setRunning(ManagedLifecycleThreadState newState)
Set the running state. |
protected boolean |
waitForRunningStateChange(ManagedLifecycleThreadState state,
long terminationPeriod)
Wait until the running state has the specified value. |
boolean |
waitUntilStopped()
Wait until the associated thread has stopped. |
boolean |
waitUntilStopped(long terminationPeriod)
Wait until the associated thread has stopped. |
boolean |
waitUntilStopping(long terminationPeriod)
Wait until the associated thread has changed to a state of "STOPPING". |
| Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle |
|---|
addManagedLifecycleEventListener, changeState, destroy, doInitialise, getConfig, getLifecycleController, getState, getTerminationPeriod, initialise, removeManagedLifecycleEventListener, start, stop, waitUntilDestroyed, waitUntilDestroyed, waitUntilNotState, waitUntilState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractThreadedManagedLifecycle(ConfigTree config)
throws ConfigurationException
config - The configuration associated with this instance.
ConfigurationException - for configuration errors during initialisation.| Method Detail |
|---|
protected void doStart()
throws ManagedLifecycleException
doStart in class AbstractManagedLifecycleManagedLifecycleException - for errors while starting.public final void run()
run in interface java.lang.Runnableprotected abstract void doRun()
protected void doStop()
throws ManagedLifecycleException
doStop in class AbstractManagedLifecycleManagedLifecycleException - for errors while stopping.
protected final void doDestroy()
throws ManagedLifecycleException
doDestroy in class AbstractManagedLifecycleManagedLifecycleException - for errors while destroying.
protected void doThreadedDestroy()
throws ManagedLifecycleException
ManagedLifecycleException - for errors while destroying.public boolean isRunning()
public boolean isStopped()
public boolean isStopping()
protected void setRunning(ManagedLifecycleThreadState newState)
newState - The new running state.public boolean waitUntilStopping(long terminationPeriod)
terminationPeriod - The maximum delay expected for the termination, specified in milliseconds.
public boolean waitUntilStopped()
public boolean waitUntilStopped(long terminationPeriod)
terminationPeriod - The maximum delay expected for the termination, specified in milliseconds.
protected boolean waitForRunningStateChange(ManagedLifecycleThreadState state,
long terminationPeriod)
state - The expected running state value.terminationPeriod - The maximum delay expected for the termination, specified in milliseconds.
public void addManagedLifecycleThreadEventListener(ManagedLifecycleThreadEventListener listener)
listener - The listener.public void removeManagedLifecycleThreadEventListener(ManagedLifecycleThreadEventListener listener)
listener - The listener.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||