Top Description Inners Methods
org.mortbay.component

public Interface LifeCycle

Known Direct Implementers
org.mortbay.component.AbstractLifeCycle
Imports
java.util.EventListener, org.mortbay.util.LazyList

The lifecycle interface for generic components.
Classes implementing this interface have a defined life cycle defined by the methods of this interface.
Author
Greg Wilkins (gregw)

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public void
public boolean

Returns:

true if the component has failed to start or has failed to stop.
isFailed
()

public boolean

Returns:

true if the component is starting or has been started.
isRunning
()

public boolean

Returns:

true if the component has been started.
isStarted
()

public boolean

Returns:

true if the component is starting.
isStarting
()

public boolean

Returns:

true if the component has been stopped.
isStopped
()

public boolean

Returns:

true if the component is stopping.
isStopping
()

public void
public void
start()

Starts the component.

public void
stop()

Stops the component.

Method Detail

addLifeCycleListenerback to summary
public void addLifeCycleListener(LifeCycle.Listener listener)
isFailedback to summary
public boolean isFailed()
Returns:boolean

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

isRunningback to summary
public boolean isRunning()
Returns:boolean

true if the component is starting or has been started.

isStartedback to summary
public boolean isStarted()
Returns:boolean

true if the component has been started.

See Also
start(), isStarting()
isStartingback to summary
public boolean isStarting()
Returns:boolean

true if the component is starting.

See Also
isStarted()
isStoppedback to summary
public boolean isStopped()
Returns:boolean

true if the component has been stopped.

See Also
stop(), isStopping()
isStoppingback to summary
public boolean isStopping()
Returns:boolean

true if the component is stopping.

See Also
isStopped()
removeLifeCycleListenerback to summary
public void removeLifeCycleListener(LifeCycle.Listener listener)
startback to summary
public void start() throws Exception

Starts the component.

Exceptions
Exception:
If the component fails to start
See Also
isStarted(), stop(), isFailed()
stopback to summary
public void stop() throws Exception

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
See Also
isStopped(), start(), isFailed()
org.mortbay.component back to summary

public Interface LifeCycle.Listener

extends EventListener

Listener. A listener for Lifecycle events.

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public void

Method Detail

lifeCycleFailureback to summary
public void lifeCycleFailure(LifeCycle event, Throwable cause)
lifeCycleStartedback to summary
public void lifeCycleStarted(LifeCycle event)
lifeCycleStartingback to summary
public void lifeCycleStarting(LifeCycle event)
lifeCycleStoppedback to summary
public void lifeCycleStopped(LifeCycle event)
lifeCycleStoppingback to summary
public void lifeCycleStopping(LifeCycle event)