|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. |
ConfigTree |
getConfig()
Get the configuration associated with this lifecycle. |
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. |
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. |
protected boolean |
waitUntilNotState(ManagedLifecycleState state,
long transitionPeriod)
Wait until the managed instance is not in the specified state. |
protected boolean |
waitUntilState(ManagedLifecycleState state,
long transitionPeriod)
Wait until the managed instance has transitioned into the specified 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 ManagedLifecycle
ManagedLifecycleException
- for errors during initialisation.protected abstract void doInitialise() throws ManagedLifecycleException
ManagedLifecycleException
- for errors while initialisation.public final void start() throws ManagedLifecycleException
start
in interface ManagedLifecycle
ManagedLifecycleException
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 ManagedLifecycle
ManagedLifecycleException
protected abstract void doStop() throws ManagedLifecycleException
ManagedLifecycleException
- for errors while stopping.public final void destroy() throws ManagedLifecycleException
destroy
in interface ManagedLifecycle
ManagedLifecycleException
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.
ManagedLifecycleException
protected long getTerminationPeriod()
public boolean waitUntilDestroyed()
waitUntilDestroyed
in interface ManagedLifecycle
public boolean waitUntilDestroyed(long transitionPeriod)
waitUntilDestroyed
in interface ManagedLifecycle
transitionPeriod
- The maximum delay expected for the transition, specified in milliseconds.
protected boolean waitUntilState(ManagedLifecycleState state, long transitionPeriod)
state
- The expected state.transitionPeriod
- The maximum delay expected for the transition, specified in milliseconds.
protected boolean waitUntilNotState(ManagedLifecycleState state, long transitionPeriod)
state
- The original state.transitionPeriod
- The maximum delay expected for the transition, specified in milliseconds.
public void addManagedLifecycleEventListener(ManagedLifecycleEventListener listener)
addManagedLifecycleEventListener
in interface ManagedLifecycle
listener
- The listener.public void removeManagedLifecycleEventListener(ManagedLifecycleEventListener listener)
removeManagedLifecycleEventListener
in interface ManagedLifecycle
listener
- The listener.public ConfigTree getConfig()
getConfig
in interface ManagedLifecycle
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |