org.jboss.soa.esb.listeners.lifecycle
Class AbstractScheduledManagedLifecycle

java.lang.Object
  extended by org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
      extended by org.jboss.soa.esb.listeners.lifecycle.AbstractScheduledManagedLifecycle
All Implemented Interfaces:
java.io.Serializable, ManagedLifecycle
Direct Known Subclasses:
AbstractFileGateway, ScheduleListener

public abstract class AbstractScheduledManagedLifecycle
extends AbstractManagedLifecycle

This class provides threaded support for a managed instance.

Author:
kevin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
PARAM_TERMINATION_PERIOD
 
Constructor Summary
protected AbstractScheduledManagedLifecycle(ConfigTree config)
          Construct the threaded managed lifecycle.
 
Method Summary
protected  void doDestroy()
          Handle the destroy of the managed instance.
protected  void doInitialise()
          Handle the initialisation of the managed instance.
protected  void doScheduledDestroy()
          Handle the scheduled destroy of the managed instance.
protected  void doStart()
          Handle the start of the managed instance.
protected  void doStop()
          Handle the stop of the managed instance.
protected abstract  void onSchedule()
          Execute the scheduled event.
 
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle
addManagedLifecycleEventListener, changeState, destroy, getConfig, 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

AbstractScheduledManagedLifecycle

protected AbstractScheduledManagedLifecycle(ConfigTree config)
                                     throws ConfigurationException
Construct the threaded managed lifecycle.

Parameters:
config - The configuration associated with this instance.
Throws:
ConfigurationException - for configuration errors during initialisation.
Method Detail

doInitialise

protected void doInitialise()
                     throws ManagedLifecycleException
Handle the initialisation of the managed instance.

Specified by:
doInitialise in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while initialisation.

doStart

protected void doStart()
                throws ManagedLifecycleException
Handle the start of the managed instance.

Specified by:
doStart in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while starting.

onSchedule

protected abstract void onSchedule()
                            throws SchedulingException
Execute the scheduled event.

Throws:
SchedulingException

doStop

protected void doStop()
               throws ManagedLifecycleException
Handle the stop of the managed instance.

Specified by:
doStop in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while stopping.

doDestroy

protected final void doDestroy()
                        throws ManagedLifecycleException
Handle the destroy of the managed instance.

Specified by:
doDestroy in class AbstractManagedLifecycle
Throws:
ManagedLifecycleException - for errors while destroying.

doScheduledDestroy

protected void doScheduledDestroy()
                           throws ManagedLifecycleException
Handle the scheduled destroy of the managed instance.

Throws:
ManagedLifecycleException - for errors while destroying.