Interface Lifecycle

    • Field Detail

      • START_EVENT

        static final String START_EVENT
        The LifecycleEvent type for the "component start" event.
        See Also:
        Constant Field Values
      • BEFORE_START_EVENT

        static final String BEFORE_START_EVENT
        The LifecycleEvent type for the "component before start" event.
        See Also:
        Constant Field Values
      • AFTER_START_EVENT

        static final String AFTER_START_EVENT
        The LifecycleEvent type for the "component after start" event.
        See Also:
        Constant Field Values
      • BEFORE_STOP_EVENT

        static final String BEFORE_STOP_EVENT
        The LifecycleEvent type for the "component before stop" event.
        See Also:
        Constant Field Values
      • AFTER_STOP_EVENT

        static final String AFTER_STOP_EVENT
        The LifecycleEvent type for the "component after stop" 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

        List<LifecycleListener> findLifecycleListeners()
        Gets the (possibly empty) list of lifecycle listeners associated with this Lifecycle instance.
      • 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