FileDocCategorySizeDatePackage
Lifecycle.javaAPI DocApache Tomcat 6.0.144472Fri Jul 20 04:20:36 BST 2007org.apache.catalina

Lifecycle

public interface Lifecycle
Common interface for component life cycle methods. Catalina components may, but are not required to, implement this interface (as well as the appropriate interface(s) for the functionality they support) in order to provide a consistent mechanism to start and stop the component.
author
Craig R. McClanahan
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static final String
INIT_EVENT
The LifecycleEvent type for the "component init" event.
public static final String
START_EVENT
The LifecycleEvent type for the "component start" event.
public static final String
BEFORE_START_EVENT
The LifecycleEvent type for the "component before start" event.
public static final String
AFTER_START_EVENT
The LifecycleEvent type for the "component after start" event.
public static final String
STOP_EVENT
The LifecycleEvent type for the "component stop" event.
public static final String
BEFORE_STOP_EVENT
The LifecycleEvent type for the "component before stop" event.
public static final String
AFTER_STOP_EVENT
The LifecycleEvent type for the "component after stop" event.
public static final String
DESTROY_EVENT
The LifecycleEvent type for the "component destroy" event.
public static final String
PERIODIC_EVENT
The LifecycleEvent type for the "periodic" event.
Constructors Summary
Methods Summary
public voidaddLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component.

param
listener The listener to add

public LifecycleListener[]findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.

public voidremoveLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component.

param
listener The listener to remove

public voidstart()
Prepare for the beginning of active use of the public methods of this component. This method should be called before any of the public methods of this component are utilized. It should also send a LifecycleEvent of type START_EVENT to any registered listeners.

exception
LifecycleException if this component detects a fatal error that prevents this component from being used

public voidstop()
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component. It should also send a LifecycleEvent of type STOP_EVENT to any registered listeners.

exception
LifecycleException if this component detects a fatal error that needs to be reported