Class LifecycleWrapper

  • All Implemented Interfaces:
    FacesWrapper<Lifecycle>

    public abstract class LifecycleWrapper
    extends Lifecycle
    implements FacesWrapper<Lifecycle>

    Provides a simple implementation of Lifecycle that can be subclassed by developers wishing to provide specialized behavior to an existing Lifecycle instance. The default implementation of all methods is to call through to the wrapped Lifecycle.

    Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped() to access the instance being wrapped.

    Since:
    2.2
    • Constructor Detail

      • LifecycleWrapper

        @Deprecated
        public LifecycleWrapper()
        Deprecated.
        Use the other constructor taking the implementation being wrapped.
      • LifecycleWrapper

        public LifecycleWrapper​(Lifecycle wrapped)

        If this lifecycle has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

        Parameters:
        wrapped - The implementation being wrapped.
        Since:
        2.3
    • Method Detail

      • getWrapped

        public Lifecycle getWrapped()
        Description copied from interface: FacesWrapper

        A class that implements this interface uses this method to return an instance of the class being wrapped.

        Specified by:
        getWrapped in interface FacesWrapper<Lifecycle>
        Returns:
        the wrapped instance.
      • addPhaseListener

        public void addPhaseListener​(PhaseListener listener)
        Description copied from class: Lifecycle

        Register a new PhaseListener instance that is interested in being notified before and after the processing for standard phases of the request processing lifecycle.

        Specified by:
        addPhaseListener in class Lifecycle
        Parameters:
        listener - The PhaseListener to be registered
      • execute

        public void execute​(FacesContext context)
                     throws FacesException
        Description copied from class: Lifecycle

        Execute all of the phases of the request processing lifecycle, up to but not including the Render Response phase, as described in section 2 "Request Processing Lifecycle" of the Jakarta Faces Specification Document, in the specified order. The processing flow can be affected (by the application, by components, or by event listeners) by calls to the renderResponse() or responseComplete() methods of the FacesContext instance associated with the current request.

        Specified by:
        execute in class Lifecycle
        Parameters:
        context - FacesContext for the request to be processed
        Throws:
        FacesException - if thrown during the execution of the request processing lifecycle
      • removePhaseListener

        public void removePhaseListener​(PhaseListener listener)
        Description copied from class: Lifecycle

        Deregister an existing PhaseListener instance that is no longer interested in being notified before and after the processing for standard phases of the request processing lifecycle. If no such listener instance has been registered, no action is taken.

        Specified by:
        removePhaseListener in class Lifecycle
        Parameters:
        listener - The PhaseListener to be deregistered
      • render

        public void render​(FacesContext context)
                    throws FacesException
        Description copied from class: Lifecycle

        Execute the Render Response phase of the request processing lifecycle, unless the responseComplete() method has been called on the FacesContext instance associated with the current request.

        Specified by:
        render in class Lifecycle
        Parameters:
        context - FacesContext for the request being processed
        Throws:
        FacesException - if an exception is thrown during the execution of the request processing lifecycle