|
|||||||||
| 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
public abstract class AbstractManagedLifecycle
This class represents the lifecycle for a managed instance.
| Field Summary | |
|---|---|
static java.lang.String |
PARAM_TERMINATION_PERIOD
The name of the attribute specifying the termination period. |
| Constructor Summary | |
|---|---|
protected |
AbstractManagedLifecycle(ConfigTree config)
Construct the managed lifecycle. |
| Method Summary | |
|---|---|
void |
addManagedLifecycleEventListener(ManagedLifecycleEventListener listener)
Add a managed lifecycle event listener. |
protected void |
changeState(ManagedLifecycleState newState)
Change the state of the managed instance. |
void |
destroy()
Destroy the managed instance. |
protected abstract void |
doDestroy()
Handle the destroy of the managed instance. |
protected abstract void |
doInitialise()
Handle the initialisation of the managed instance. |
protected abstract void |
doStart()
Handle the start of the managed instance. |
protected abstract void |
doStop()
Handle the stop of the managed instance. |
ManagedLifecycleState |
getState()
Get the state of the managed instance. |
protected long |
getTerminationPeriod()
Get the termination period for this service. |
void |
initialise()
Initialise the managed instance. |
void |
removeManagedLifecycleEventListener(ManagedLifecycleEventListener listener)
Remove a managed lifecycle event listener. |
void |
start()
Start the managed instance. |
void |
stop()
Stop the managed instance. |
protected boolean |
waitForStateChange(ManagedLifecycleState state,
long transitionPeriod)
Wait until the managed instance has transitioned into the specified state. |
boolean |
waitUntilDestroyed()
Wait until the managed instance has transitioned into the DESTROYED state. |
boolean |
waitUntilDestroyed(long transitionPeriod)
Wait until the managed instance has transitioned into the DESTROYED state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PARAM_TERMINATION_PERIOD
| Constructor Detail |
|---|
protected AbstractManagedLifecycle(ConfigTree config)
throws ConfigurationException
config - The configuration associated with this instance.
ConfigurationException - for configuration errors during initialisation.| Method Detail |
|---|
public final void initialise()
throws ManagedLifecycleException
initialise in interface ManagedLifecycleManagedLifecycleException - for errors during initialisation.
protected abstract void doInitialise()
throws ManagedLifecycleException
ManagedLifecycleException - for errors while initialisation.
public final void start()
throws ManagedLifecycleException
start in interface ManagedLifecycleManagedLifecycleException
protected abstract void doStart()
throws ManagedLifecycleException
ManagedLifecycleException - for errors while starting.
public final void stop()
throws ManagedLifecycleException
start() or destroy() blocks until these resources have been
disabled.
stop in interface ManagedLifecycleManagedLifecycleException
protected abstract void doStop()
throws ManagedLifecycleException
ManagedLifecycleException - for errors while stopping.
public final void destroy()
throws ManagedLifecycleException
destroy in interface ManagedLifecycleManagedLifecycleException
protected abstract void doDestroy()
throws ManagedLifecycleException
ManagedLifecycleException - for errors while destroying.public ManagedLifecycleState getState()
getState in interface ManagedLifecycle
protected void changeState(ManagedLifecycleState newState)
throws ManagedLifecycleException
newState - The new state of the managed instance.
ManagedLifecycleExceptionprotected long getTerminationPeriod()
public boolean waitUntilDestroyed()
waitUntilDestroyed in interface ManagedLifecyclepublic boolean waitUntilDestroyed(long transitionPeriod)
waitUntilDestroyed in interface ManagedLifecycletransitionPeriod - The maximum delay expected for the transition, specified in milliseconds.
protected boolean waitForStateChange(ManagedLifecycleState state,
long transitionPeriod)
state - The expected state.transitionPeriod - The maximum delay expected for the transition, specified in milliseconds.
public void addManagedLifecycleEventListener(ManagedLifecycleEventListener listener)
addManagedLifecycleEventListener in interface ManagedLifecyclelistener - The listener.public void removeManagedLifecycleEventListener(ManagedLifecycleEventListener listener)
removeManagedLifecycleEventListener in interface ManagedLifecyclelistener - The listener.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||