Class 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 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 type
        data - 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.