org.mortbay.component
Class AbstractLifeCycle
java.lang.Object
org.mortbay.component.AbstractLifeCycle
- All Implemented Interfaces:
- LifeCycle
- Direct Known Subclasses:
- AbstractBuffers, AbstractHandler, AbstractSessionIdManager, AbstractSessionManager, BayeuxClient, BoundedThreadPool, ContextDeployer, HashSessionIdManager, HashUserRealm, Holder, NCSARequestLog, Oort, QueuedThreadPool, ResourceCache, SelectorManager, Seti, TerracottaSessionIdManager, WebAppDeployer, Win32Service
public abstract class AbstractLifeCycle
- extends Object
- implements LifeCycle
Basic implementation of the life cycle interface for components.
- Author:
- gregw
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_listeners
protected LifeCycle.Listener[] _listeners
AbstractLifeCycle
public AbstractLifeCycle()
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
- Starts the component.
- Specified by:
start
in interface LifeCycle
- Throws:
Exception
- If the component fails to start- See Also:
LifeCycle.isStarted()
,
LifeCycle.stop()
,
LifeCycle.isFailed()
stop
public final void stop()
throws Exception
- Description copied from interface:
LifeCycle
- Stops the component.
The component may wait for current activities to complete
normally, but it can be interrupted.
- Specified by:
stop
in interface LifeCycle
- Throws:
Exception
- If the component fails to stop- See Also:
LifeCycle.isStopped()
,
LifeCycle.start()
,
LifeCycle.isFailed()
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface LifeCycle
- Returns:
- true if the component is starting or has been started.
isStarted
public boolean isStarted()
- Specified by:
isStarted
in interface LifeCycle
- Returns:
- true if the component has been started.
- See Also:
LifeCycle.start()
,
LifeCycle.isStarting()
isStarting
public boolean isStarting()
- Specified by:
isStarting
in interface LifeCycle
- Returns:
- true if the component is starting.
- See Also:
LifeCycle.isStarted()
isStopping
public boolean isStopping()
- Specified by:
isStopping
in interface LifeCycle
- Returns:
- true if the component is stopping.
- See Also:
LifeCycle.isStopped()
isStopped
public boolean isStopped()
- Specified by:
isStopped
in interface LifeCycle
- Returns:
- true if the component has been stopped.
- See Also:
LifeCycle.stop()
,
LifeCycle.isStopping()
isFailed
public boolean isFailed()
- Specified by:
isFailed
in interface LifeCycle
- Returns:
- true if the component has failed to start or has failed to stop.
addLifeCycleListener
public void addLifeCycleListener(LifeCycle.Listener listener)
- Specified by:
addLifeCycleListener
in interface LifeCycle
removeLifeCycleListener
public void removeLifeCycleListener(LifeCycle.Listener listener)
- Specified by:
removeLifeCycleListener
in interface LifeCycle
Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.