org.mortbay.component
Class AbstractLifeCycle

java.lang.Object
  extended byorg.mortbay.component.AbstractLifeCycle
All Implemented Interfaces:
LifeCycle
Direct Known Subclasses:
AbstractConnector, AbstractHandler, AbstractSessionManager, BoundedThreadPool, HashSessionIdManager, Holder, NCSARequestLog, ResourceCache

public abstract class AbstractLifeCycle
extends Object
implements LifeCycle

Author:
gregw

Constructor Summary
AbstractLifeCycle()
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 boolean isFailed()
           
 boolean isRunning()
           
 boolean isStarted()
           
 boolean isStarting()
           
 boolean isStopping()
           
 void start()
          Start the LifeCycle.
 void stop()
          Stop the LifeCycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLifeCycle

public AbstractLifeCycle()
Method Detail

doStart

protected void doStart()
                throws Exception
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Throws:
Exception

start

public final void start()
                 throws Exception
Description copied from interface: LifeCycle
Start the LifeCycle.

Specified by:
start in interface LifeCycle
Throws:
Exception - An arbitrary exception may be thrown.

stop

public final void stop()
                throws Exception
Description copied from interface: LifeCycle
Stop the LifeCycle. The LifeCycle may wait for current activities to complete normally, but it can be interrupted.

Specified by:
stop in interface LifeCycle
Throws:
Exception - An arbitrary exception may be thrown.

isRunning

public boolean isRunning()
Specified by:
isRunning in interface LifeCycle
Returns:
True if the LifeCycle is starting or has been started.

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle
Returns:
True if the LifeCycle has been started.

isStarting

public boolean isStarting()
Specified by:
isStarting in interface LifeCycle
Returns:
True if the LifeCycle is starting.

isStopping

public boolean isStopping()
Specified by:
isStopping in interface LifeCycle
Returns:
True if the LifeCycle is stopping

isFailed

public boolean isFailed()
Specified by:
isFailed in interface LifeCycle
Returns:
True if the LifeCycle is failed