Top Description Fields Constructors Methods
org.mortbay.component

public abstract Class AbstractLifeCycle

extends Object
implements LifeCycle
Class Inheritance
All Implemented Interfaces
org.mortbay.component.LifeCycle
Known Direct Subclasses
org.mortbay.thread.BoundedThreadPool, org.mortbay.thread.QueuedThreadPool
Imports
org.mortbay.log.Log, org.mortbay.util.LazyList

Basic implementation of the life cycle interface for components.
Author
gregw

Field Summary

Modifier and TypeField and Description
protected LifeCycle.Listener[]
private Object
private transient int
private final int
private final int
private final int
private final int
private final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected void
protected void
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public void
private void
private void
private void
private void
private void
public final void
start()

Implements org.mortbay.component.LifeCycle.start.

Starts the component.
public final void
stop()

Implements org.mortbay.component.LifeCycle.stop.

Stops the component.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_listenersback to summary
protected LifeCycle.Listener[] _listeners
_lockback to summary
private Object _lock
_stateback to summary
private transient int _state
FAILEDback to summary
private final int FAILED
STARTEDback to summary
private final int STARTED
STARTINGback to summary
private final int STARTING
STOPPEDback to summary
private final int STOPPED
STOPPINGback to summary
private final int STOPPING

Constructor Detail

AbstractLifeCycleback to summary
public AbstractLifeCycle()

Method Detail

addLifeCycleListenerback to summary
public void addLifeCycleListener(LifeCycle.Listener listener)

Implements org.mortbay.component.LifeCycle.addLifeCycleListener.

doStartback to summary
protected void doStart() throws Exception
doStopback to summary
protected void doStop() throws Exception
isFailedback to summary
public boolean isFailed()

Implements org.mortbay.component.LifeCycle.isFailed.

Returns:boolean

Doc from org.mortbay.component.LifeCycle.isFailed.

true if the component has failed to start or has failed to stop.

isRunningback to summary
public boolean isRunning()

Implements org.mortbay.component.LifeCycle.isRunning.

Returns:boolean

Doc from org.mortbay.component.LifeCycle.isRunning.

true if the component is starting or has been started.

isStartedback to summary
public boolean isStarted()

Implements org.mortbay.component.LifeCycle.isStarted.

Returns:boolean

Doc from org.mortbay.component.LifeCycle.isStarted.

true if the component has been started.

isStartingback to summary
public boolean isStarting()

Implements org.mortbay.component.LifeCycle.isStarting.

Returns:boolean

Doc from org.mortbay.component.LifeCycle.isStarting.

true if the component is starting.

isStoppedback to summary
public boolean isStopped()

Implements org.mortbay.component.LifeCycle.isStopped.

Returns:boolean

Doc from org.mortbay.component.LifeCycle.isStopped.

true if the component has been stopped.

isStoppingback to summary
public boolean isStopping()

Implements org.mortbay.component.LifeCycle.isStopping.

Returns:boolean

Doc from org.mortbay.component.LifeCycle.isStopping.

true if the component is stopping.

removeLifeCycleListenerback to summary
public void removeLifeCycleListener(LifeCycle.Listener listener)

Implements org.mortbay.component.LifeCycle.removeLifeCycleListener.

setFailedback to summary
private void setFailed(Throwable error)
setStartedback to summary
private void setStarted()
setStartingback to summary
private void setStarting()
setStoppedback to summary
private void setStopped()
setStoppingback to summary
private void setStopping()
startback to summary
public final void start() throws Exception

Implements org.mortbay.component.LifeCycle.start.

Doc from org.mortbay.component.LifeCycle.start.

Starts the component.

Exceptions
Exception:
If the component fails to start
stopback to summary
public final void stop() throws Exception

Implements org.mortbay.component.LifeCycle.stop.

Doc from org.mortbay.component.LifeCycle.stop.

Stops the component. The component may wait for current activities to complete normally, but it can be interrupted.

Exceptions
Exception:
If the component fails to stop