Package org.apache.catalina.util
Class LifecycleSupport
- java.lang.Object
-
- org.apache.catalina.util.LifecycleSupport
-
public final class LifecycleSupport extends Object
Support class to assist in firing LifecycleEvent notifications to registered LifecycleListeners.- Version:
- $Id: LifecycleSupport.java,v 1.2 2005/12/08 01:28:17 kchung Exp $
- Author:
- Craig R. McClanahan
-
-
Constructor Summary
Constructors Constructor Description LifecycleSupport(Lifecycle lifecycle)
Construct a new LifecycleSupport object associated with the specified Lifecycle component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.List<LifecycleListener>
findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated with this LifecycleSupport instance.void
fireLifecycleEvent(String type, Object data)
Notify all lifecycle event listeners that a particular event has occurred for this Container.void
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.void
removeLifecycleListeners()
Removes any lifecycle event listeners from this LifecycleSupport instance.
-
-
-
Constructor Detail
-
LifecycleSupport
public LifecycleSupport(Lifecycle lifecycle)
Construct a new LifecycleSupport object associated with the specified Lifecycle component.- Parameters:
lifecycle
- The Lifecycle component that will be the source of events that we fire
-
-
Method Detail
-
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.- Parameters:
listener
- The listener to add
-
findLifecycleListeners
public List<LifecycleListener> findLifecycleListeners()
Gets the (possibly empty) list of lifecycle listeners associated with this LifecycleSupport instance.
-
fireLifecycleEvent
public void fireLifecycleEvent(String type, Object data) throws LifecycleException
Notify all lifecycle event listeners that a particular event has occurred for this Container. The default implementation performs this notification synchronously using the calling thread.- Parameters:
type
- Event typedata
- Event data- Throws:
LifecycleException
-
removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.- Parameters:
listener
- The listener to remove
-
removeLifecycleListeners
public void removeLifecycleListeners()
Removes any lifecycle event listeners from this LifecycleSupport instance.
-
-