## org.apache.catalina
Interface Lifecycle

All Known Subinterfaces:
  Executor

All Known Implementing Classes:
  AccessLogValve, AuthenticatorBase, BackupManager, BasicAuthenticator, Catalina, ClusterManagerBase, ClusterSingleSignOn, CombinedRealm, CometConnectionManagerValve, Connector, ContainerBase, DataSourceRealm, DeltaManager, DigestAuthenticator, Embedded, ExtendedAccessLogValve, FastCommonAccessLogValve, FileStore, FormAuthenticator, JAASMemoryLoginModule, JAASRealm, JDBCAccessLogValve, JDBCRealm, JDBCStore, JNDIRealm, JvmRouteBinderValve, LockOutRealm, MemoryRealm, NonLoginAuthenticator, PersistentManager, PersistentManagerBase, RealmBase, ReplicatedContext, SemaphoreValve, SimpleTcpCluster, SimpleTcpReplicationManager, SingleSignOn, SSLAuthenticator, StandardContext, StandardEngine, StandardHost, StandardManager, StandardPipeline, StandardServer, StandardService, StandardThreadExecutor, StandardWrapper, StoreBase, UserDatabaseRealm, VirtualWebappLoader, WebappClassLoader, WebappLoader

    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.

Version:
  $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $
Author:
  Craig R. McClanahan

Field Summary
`static java.lang.String` `AFTER_START_EVENT` The LifecycleEvent type for the "component after start" event.
`static java.lang.String` `AFTER_STOP_EVENT` The LifecycleEvent type for the "component after stop" event.
`static java.lang.String` `BEFORE_START_EVENT` The LifecycleEvent type for the "component before start" event.
`static java.lang.String` `BEFORE_STOP_EVENT` The LifecycleEvent type for the "component before stop" event.
`static java.lang.String` `DESTROY_EVENT` The LifecycleEvent type for the "component destroy" event.
`static java.lang.String` `INIT_EVENT` The LifecycleEvent type for the "component init" event.
`static java.lang.String` `PERIODIC_EVENT` The LifecycleEvent type for the "periodic" event.
`static java.lang.String` `START_EVENT` The LifecycleEvent type for the "component start" event.
`static java.lang.String` `STOP_EVENT` The LifecycleEvent type for the "component stop" event.

Method Summary
`void` `addLifecycleListener(LifecycleListener listener)` Add a LifecycleEvent listener to this component.
`LifecycleListener[]` `findLifecycleListeners()` Get the lifecycle listeners associated with this lifecycle.
`void` `removeLifecycleListener(LifecycleListener listener)` Remove a LifecycleEvent listener from this component.
`void` `start()` Prepare for the beginning of active use of the public methods of this component.
`void` `stop()` Gracefully terminate the active use of the public methods of this component.

Field Detail

### INIT_EVENT

    static final java.lang.String INIT_EVENT

  The LifecycleEvent type for the "component init" event.

  See Also:
    Constant Field Values

### START_EVENT

    static final java.lang.String START_EVENT

  The LifecycleEvent type for the "component start" event.

  See Also:
    Constant Field Values

### BEFORE_START_EVENT

    static final java.lang.String BEFORE_START_EVENT

  The LifecycleEvent type for the "component before start" event.

  See Also:
    Constant Field Values

### AFTER_START_EVENT

    static final java.lang.String AFTER_START_EVENT

  The LifecycleEvent type for the "component after start" event.

  See Also:
    Constant Field Values

### STOP_EVENT

    static final java.lang.String STOP_EVENT

  The LifecycleEvent type for the "component stop" event.

  See Also:
    Constant Field Values

### BEFORE_STOP_EVENT

    static final java.lang.String BEFORE_STOP_EVENT

  The LifecycleEvent type for the "component before stop" event.

  See Also:
    Constant Field Values

### AFTER_STOP_EVENT

    static final java.lang.String AFTER_STOP_EVENT

  The LifecycleEvent type for the "component after stop" event.

  See Also:
    Constant Field Values

### DESTROY_EVENT

    static final java.lang.String DESTROY_EVENT

  The LifecycleEvent type for the "component destroy" event.

  See Also:
    Constant Field Values

### PERIODIC_EVENT

    static final java.lang.String PERIODIC_EVENT

  The LifecycleEvent type for the "periodic" event.

  See Also:
    Constant Field Values

Method Detail

### addLifecycleListener

    void addLifecycleListener(LifecycleListener listener)

  Add a LifecycleEvent listener to this component.

  Parameters:
    `listener` - The listener to add

### findLifecycleListeners

    LifecycleListener[] findLifecycleListeners()

  Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.

### removeLifecycleListener

    void removeLifecycleListener(LifecycleListener listener)

  Remove a LifecycleEvent listener from this component.

  Parameters:
    `listener` - The listener to remove

### start

    void start()
               throws LifecycleException

  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.

  Throws:
    `LifecycleException` - if this component detects a fatal error that prevents this component from being used

### stop

    void stop()
              throws LifecycleException

  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.

  Throws:
    `LifecycleException` - if this component detects a fatal error that needs to be reported

Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.