Class LifecycleWrapper
- java.lang.Object
-
- javax.faces.lifecycle.Lifecycle
-
- javax.faces.lifecycle.LifecycleWrapper
-
- All Implemented Interfaces:
FacesWrapper<Lifecycle>
public abstract class LifecycleWrapper extends Lifecycle implements FacesWrapper<Lifecycle>
Provides a simple implementation of
Lifecyclethat can be subclassed by developers wishing to provide specialized behavior to an existingLifecycleinstance. The default implementation of all methods is to call through to the wrappedLifecycle.Usage: extend this class and override getWrapped() to return the instance we are wrapping.
- Since:
- 2.2
-
-
Constructor Summary
Constructors Constructor Description LifecycleWrapper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddPhaseListener(PhaseListener listener)Register a newPhaseListenerinstance that is interested in being notified before and after the processing for standard phases of the request processing lifecycle.voidattachWindow(FacesContext context)Create or restore theClientWindowto be used to display theUIViewRootfor this run through the lifecycle.voidexecute(FacesContext context)Execute all of the phases of the request processing lifecycle, up to but not including the Render Response phase, as described in the JavaServer Faces Specification, in the specified order.PhaseListener[]getPhaseListeners()Return the set of registeredPhaseListeners for thisLifecycleinstance.abstract LifecyclegetWrapped()A class that implements this interface uses this method to return an instance of the class being wrapped.voidremovePhaseListener(PhaseListener listener)Deregister an existingPhaseListenerinstance that is no longer interested in being notified before and after the processing for standard phases of the request processing lifecycle.voidrender(FacesContext context)Execute the Render Response phase of the request processing lifecycle, unless theresponseComplete()method has been called on theFacesContextinstance associated with the current request.
-
-
-
Method Detail
-
getWrapped
public abstract Lifecycle getWrapped()
Description copied from interface:FacesWrapperA class that implements this interface uses this method to return an instance of the class being wrapped.
- Specified by:
getWrappedin interfaceFacesWrapper<Lifecycle>
-
addPhaseListener
public void addPhaseListener(PhaseListener listener)
Description copied from class:LifecycleRegister a new
PhaseListenerinstance that is interested in being notified before and after the processing for standard phases of the request processing lifecycle.- Specified by:
addPhaseListenerin classLifecycle- Parameters:
listener- ThePhaseListenerto be registered
-
execute
public void execute(FacesContext context) throws FacesException
Description copied from class:LifecycleExecute all of the phases of the request processing lifecycle, up to but not including the Render Response phase, as described in the JavaServer Faces Specification, in the specified order. The processing flow can be affected (by the application, by components, or by event listeners) by calls to the
renderResponse()orresponseComplete()methods of theFacesContextinstance associated with the current request.- Specified by:
executein classLifecycle- Parameters:
context- FacesContext for the request to be processed- Throws:
FacesException- if thrown during the execution of the request processing lifecycle
-
getPhaseListeners
public PhaseListener[] getPhaseListeners()
Description copied from class:LifecycleReturn the set of registered
PhaseListeners for thisLifecycleinstance. If there are no registered listeners, a zero-length array is returned.- Specified by:
getPhaseListenersin classLifecycle
-
removePhaseListener
public void removePhaseListener(PhaseListener listener)
Description copied from class:LifecycleDeregister an existing
PhaseListenerinstance 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:
removePhaseListenerin classLifecycle- Parameters:
listener- ThePhaseListenerto be deregistered
-
render
public void render(FacesContext context) throws FacesException
Description copied from class:LifecycleExecute the Render Response phase of the request processing lifecycle, unless the
responseComplete()method has been called on theFacesContextinstance associated with the current request.- Specified by:
renderin classLifecycle- Parameters:
context- FacesContext for the request being processed- Throws:
FacesException- if an exception is thrown during the execution of the request processing lifecycle
-
attachWindow
public void attachWindow(FacesContext context)
Description copied from class:LifecycleCreate or restore the
ClientWindowto be used to display theUIViewRootfor this run through the lifecycle. See the class documentation forClientWindowfor an overview of the feature. IfExternalContext.getClientWindow()returns null, create a new instance ofClientWindowusing theClientWindowFactory. If the result is non-null, callClientWindow.decode(javax.faces.context.FacesContext)on it. Store the newClientWindowby callingExternalContext.setClientWindow(javax.faces.lifecycle.ClientWindow).- Overrides:
attachWindowin classLifecycle
-
-