Top Description Fields Constructors Methods
jakarta.faces.lifecycle

public abstract Class LifecycleWrapper

extends Lifecycle
implements FacesWrapper<Lifecycle>
Class Inheritance
All Implemented Interfaces
jakarta.faces.FacesWrapper
Imports
jakarta.faces.FacesException, .FacesWrapper, jakarta.faces.context.FacesContext, jakarta.faces.event.PhaseListener

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

Field Summary

Modifier and TypeField and Description
private Lifecycle

Constructor Summary

AccessConstructor and Description
public
LifecycleWrapper()
Deprecated Use the other constructor taking the implementation being wrapped.

public
LifecycleWrapper(Lifecycle
The implementation being wrapped.
wrapped
)

If this lifecycle has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public void
addPhaseListener(PhaseListener
The PhaseListener to be registered
listener
)

Implements abstract jakarta.faces.lifecycle.Lifecycle.addPhaseListener.

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

public void
attachWindow(FacesContext
the FacesContext for this request.
context
)

Overrides jakarta.faces.lifecycle.Lifecycle.attachWindow.

Create or restore the ClientWindow to be used to display the jakarta.faces.component.UIViewRoot for this run through the lifecycle.

public void
execute(FacesContext
FacesContext for the request to be processed
context
)

Implements abstract jakarta.faces.lifecycle.Lifecycle.execute.

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.

public PhaseListener[]
getPhaseListeners()

Implements abstract jakarta.faces.lifecycle.Lifecycle.getPhaseListeners.

Return the set of registered PhaseListeners for this Lifecycle instance.

public Lifecycle
getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

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

public void
removePhaseListener(PhaseListener
The PhaseListener to be deregistered
listener
)

Implements abstract jakarta.faces.lifecycle.Lifecycle.removePhaseListener.

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.

public void
render(FacesContext
FacesContext for the request being processed
context
)

Implements abstract jakarta.faces.lifecycle.Lifecycle.render.

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.

Field Detail

wrappedback to summary
private Lifecycle wrapped

Constructor Detail

LifecycleWrapperback to summary
public LifecycleWrapper()

Deprecated

Use the other constructor taking the implementation being wrapped.

Annotations
@Deprecated
LifecycleWrapperback to summary
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:Lifecycle

The implementation being wrapped.

Since
2.3

Method Detail

addPhaseListenerback to summary
public void addPhaseListener(PhaseListener listener)

Implements abstract jakarta.faces.lifecycle.Lifecycle.addPhaseListener.

Doc from jakarta.faces.lifecycle.Lifecycle.addPhaseListener.

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

Parameters
listener:PhaseListener

The PhaseListener to be registered

Annotations
@Override
attachWindowback to summary
public void attachWindow(FacesContext context)

Overrides jakarta.faces.lifecycle.Lifecycle.attachWindow.

Doc from jakarta.faces.lifecycle.Lifecycle.attachWindow.

Create or restore the ClientWindow to be used to display the jakarta.faces.component.UIViewRoot for this run through the lifecycle. See the class documentation for ClientWindow for an overview of the feature. If jakarta.faces.context.ExternalContext#getClientWindow() returns null, create a new instance of ClientWindow using the ClientWindowFactory. If the result is non-null, call ClientWindow#decode(jakarta.faces.context.FacesContext) on it. Store the new ClientWindow by calling jakarta.faces.context.ExternalContext#setClientWindow(jakarta.faces.lifecycle.ClientWindow).

Parameters
context:FacesContext

the FacesContext for this request.

Annotations
@Override
executeback to summary
public void execute(FacesContext context) throws FacesException

Implements abstract jakarta.faces.lifecycle.Lifecycle.execute.

Doc from jakarta.faces.lifecycle.Lifecycle.execute.

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.

Parameters
context:FacesContext

FacesContext for the request to be processed

Annotations
@Override
Exceptions
FacesException:
if thrown during the execution of the request processing lifecycle
getPhaseListenersback to summary
public PhaseListener[] getPhaseListeners()

Implements abstract jakarta.faces.lifecycle.Lifecycle.getPhaseListeners.

Doc from jakarta.faces.lifecycle.Lifecycle.getPhaseListeners.

Return the set of registered PhaseListeners for this Lifecycle instance. If there are no registered listeners, a zero-length array is returned.

Returns:PhaseListener[]

the set of registered PhaseListeners

Annotations
@Override
getWrappedback to summary
public Lifecycle getWrapped()

Implements jakarta.faces.FacesWrapper.getWrapped.

Doc from jakarta.faces.FacesWrapper.getWrapped.

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

Returns:Lifecycle

the wrapped instance.

Annotations
@Override
removePhaseListenerback to summary
public void removePhaseListener(PhaseListener listener)

Implements abstract jakarta.faces.lifecycle.Lifecycle.removePhaseListener.

Doc from jakarta.faces.lifecycle.Lifecycle.removePhaseListener.

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.

Parameters
listener:PhaseListener

The PhaseListener to be deregistered

Annotations
@Override
renderback to summary
public void render(FacesContext context) throws FacesException

Implements abstract jakarta.faces.lifecycle.Lifecycle.render.

Doc from jakarta.faces.lifecycle.Lifecycle.render.

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.

Parameters
context:FacesContext

FacesContext for the request being processed

Annotations
@Override
Exceptions
FacesException:
if an exception is thrown during the execution of the request processing lifecycle