Lifecycle (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.faces.lifecycle Class Lifecycle

java.lang.Object
  extended by javax.faces.lifecycle.Lifecycle

public abstract class Lifecycle
extends Object

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.

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.


构造器摘要
Lifecycle()
           
 
方法摘要
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.
abstract  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.
abstract  PhaseListener[] getPhaseListeners()
          Return the set of registered PhaseListeners for this Lifecycle instance.
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.
abstract  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.
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造器详细信息

Lifecycle

public Lifecycle()
方法详细信息

addPhaseListener

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.

参数:
listener - The PhaseListener to be registered
抛出异常:
NullPointerException - if listener is null

execute

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

参数:
context - FacesContext for the request to be processed
抛出异常:
FacesException - if thrown during the execution of the request processing lifecycle
NullPointerException - if context is null

getPhaseListeners

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.


removePhaseListener

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.

参数:
listener - The PhaseListener to be deregistered
抛出异常:
NullPointerException - if listener is null

render

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.

参数:
context - FacesContext for the request being processed
抛出异常:
FacesException - if an exception is thrown during the execution of the request processing lifecycle
NullPointerException - if context is null

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.