JSF-Spring

de.mindmatters.faces.lifecycle
Class LifecycleImpl

java.lang.Object
  extended by javax.faces.lifecycle.Lifecycle
      extended by de.mindmatters.faces.lifecycle.LifecycleImpl

public final class LifecycleImpl
extends Lifecycle

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

This implemetation delegates the execution of each phase to an instance of Phase. At least a Lifecycle should execute phases as follows:

Phase default implementation
RESTORE_VIEW RestoreViewPhase
APPLY_REQUEST_VALUES ApplyRequestValuesPhase
PROCESS_VALIDATIONS ProcessValidationsPhase
UPDATE_MODEL_VALUES UpdateModelValuesPhase
INVOKE_APPLICATION InvokeApplicationPhase
RENDER_RESPONSE RenderResponsePhase

Author:
Andreas Kuhrwahl
See Also:
Phase, Phase.execute(FacesContext)

Field Summary
static java.lang.String JSF_SPRING_LIFECYCLE_ID
          The lifecycle-id of the Lifecycle which processes the entire lifecycle of a particular JavaServer Faces request mapped against the FacesDispatcherServlet (which integrates SpringMVC into JSF).
protected  org.apache.commons.logging.Log log
          For logging.
 
Constructor Summary
LifecycleImpl(Phase[] executionPhases, Phase renderResponsePhase)
          Creates a lifecycle with the given executionPhases and renderResponsePhase.
 
Method Summary
 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.

static Lifecycle createDefaultLifecycle()
          Factory method creating the default Lifecycle for a particular JavaServer Faces request.
 void execute(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 registered PhaseListeners for this Lifecycle instance.

 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.

 void render(FacesContext 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.

 void setExecutionPhases(Phase[] executionPhases)
          Sets the phases to execute.
 void setRenderResponsePhase(Phase renderResponsePhase)
          Sets the render-response phase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSF_SPRING_LIFECYCLE_ID

public static final java.lang.String JSF_SPRING_LIFECYCLE_ID
The lifecycle-id of the Lifecycle which processes the entire lifecycle of a particular JavaServer Faces request mapped against the FacesDispatcherServlet (which integrates SpringMVC into JSF).

See Also:
Constant Field Values

log

protected final org.apache.commons.logging.Log log
For logging.

Constructor Detail

LifecycleImpl

public LifecycleImpl(Phase[] executionPhases,
                     Phase renderResponsePhase)
Creates a lifecycle with the given executionPhases and renderResponsePhase.

Parameters:
executionPhases - phases to execute
renderResponsePhase - for rendering
Method Detail

createDefaultLifecycle

public static Lifecycle createDefaultLifecycle()
Factory method creating the default Lifecycle for a particular JavaServer Faces request.

Returns:
the default Lifecycle
See Also:
LifecycleFactory.DEFAULT_LIFECYCLE

execute

public void execute(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. 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

render

public void render(FacesContext 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.

Specified by:
render in class Lifecycle
Parameters:
context - FacesContext for the request being processed

addPhaseListener

public 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.

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

getPhaseListeners

public PhaseListener[] getPhaseListeners()

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

Specified by:
getPhaseListeners in class Lifecycle

removePhaseListener

public 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.

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

setExecutionPhases

public void setExecutionPhases(Phase[] executionPhases)
Sets the phases to execute.

Parameters:
executionPhases - phases to execute
See Also:
Lifecycle.execute(FacesContext)

setRenderResponsePhase

public void setRenderResponsePhase(Phase renderResponsePhase)
Sets the render-response phase.

Parameters:
renderResponsePhase - for rendering
See Also:
Lifecycle.render(FacesContext)

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG