Top Description Constructors Methods
jakarta.faces.lifecycle

public abstract Class Lifecycle

extends Object
Class Inheritance
Known Direct Subclasses
jakarta.faces.lifecycle.LifecycleWrapper, com.sun.faces.lifecycle.LifecycleImpl
Imports
jakarta.faces.FacesException, jakarta.faces.context.FacesContext, jakarta.faces.event.PhaseListener

Lifecycle manages the processing of the entire lifecycle of a particular Jakarta Faces request. It is responsible for executing all of the phases that have been defined by the Jakarta Faces Specification, in the specified order, unless otherwise directed by activities that occurred during the execution of each phase.

An instance of Lifecycle is created by calling the getLifecycle() method of LifecycleFactory, for a specified lifecycle identifier. Because this instance is shared across multiple simultaneous requests, it must be implemented in a thread-safe manner.

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

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
)

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

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

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 abstract PhaseListener[]

Returns:

the set of registered PhaseListeners
getPhaseListeners
()

Return the set of registered PhaseListeners for this Lifecycle instance.

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

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 abstract void
render(FacesContext
FacesContext for the request being processed
context
)

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Lifecycleback to summary
public Lifecycle()

Method Detail

addPhaseListenerback to summary
public abstract void addPhaseListener(PhaseListener listener)

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

Exceptions
NullPointerException:
if listener is null
attachWindowback to summary
public void attachWindow(FacesContext context)

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.

Since
2.2
executeback to summary
public abstract void execute(FacesContext context) throws FacesException

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

Exceptions
FacesException:
if thrown during the execution of the request processing lifecycle
NullPointerException:
if context is null
getPhaseListenersback to summary
public abstract PhaseListener[] 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

removePhaseListenerback to summary
public abstract void removePhaseListener(PhaseListener listener)

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

Exceptions
NullPointerException:
if listener is null
renderback to summary
public abstract void render(FacesContext context) throws FacesException

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

Exceptions
FacesException:
if an exception is thrown during the execution of the request processing lifecycle
NullPointerException:
if context is null