|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.faces.lifecycle Class Lifecycle
java.lang.Object javax.faces.lifecycle.Lifecycle
public abstract class Lifecycle
- extends Object
Lifecycle 管理特定 JavaServer Faces 请求的整个生命周期处理过程。它负责以指定的顺序执行 JavaServer Faces 规范中定义的所有阶段,除非在执行各个阶段期间发生的活动指示采用其他顺序。
Lifecycle
的实例可以通过对指定的生命周期标识符调用 LifecycleFactory
的 getLifecycle()
方法创建。因为此实例由多个同步请求共享,所以它必须以线程安全的方式实现。
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.
Constructor Summary | |
---|---|
Lifecycle()
|
Method Summary | |
---|---|
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 PhaseListener s 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
Lifecycle()
英文文档:
Lifecycle
public Lifecycle()
Method Detail |
---|
abstract public void
addPhaseListener(PhaseListener listener)
注册新的 PhaseListener
实例,在处理请求处理生命周期的标准阶段之前和之后将通知该实例。
listener |
要注册的 PhaseListener |
Throws | NullPointerException:
如果 listener 为 null |
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.- Parameters:
listener
- ThePhaseListener
to be registered- Throws:
NullPointerException
- iflistener
isnull
abstract public void
execute(FacesContext context) throws FacesException
以指定的顺序执行请求处理生命周期的所有阶段,直到但不包括呈现响应 阶段,如 JavaServer Faces 规范中所述。(应用程序、组件或事件侦听器)可以通过调用当前请求关联的 FacesContext
实例的 renderResponse()
或 responseComplete()
方法影响处理流。
context | 要处理的请求的 FacesContext |
Throws | FacesException: 如果在执行请求处理生命周期的过程中抛出 |
Throws | NullPointerException:
如果 context 为 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()
orresponseComplete()
methods of theFacesContext
instance associated with the current request.- Parameters:
context
- FacesContext for the request to be processed- Throws:
FacesException
- if thrown during the execution of the request processing lifecycleNullPointerException
- ifcontext
isnull
abstract public PhaseListener[]
getPhaseListeners()
返回针对此 Lifecycle
实例注册的 PhaseListener
集。如果不存在任何已注册侦听器,则此方法返回一个长度为 0 的数组。
getPhaseListeners
public abstract PhaseListener[] getPhaseListeners()
Return the set of registered
PhaseListener
s for thisLifecycle
instance. If there are no registered listeners, a zero-length array is returned.
abstract public void
removePhaseListener(PhaseListener listener)
取消注册现有的 PhaseListener
实例,在处理请求处理生命周期的标准阶段之前和之后不再通知该实例。如果没有注册任何侦听器实例,则不执行任何操作。
listener |
要取消注册的 PhaseListener |
Throws | NullPointerException:
如果 listener 为 null |
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.- Parameters:
listener
- ThePhaseListener
to be deregistered- Throws:
NullPointerException
- iflistener
isnull
abstract public void
render(FacesContext context) throws FacesException
执行请求处理生命周期的呈现响应 阶段,除非对当前请求关联的 FacesContext
实例调用 responseComplete()
方法。
context | 要处理的请求的 FacesContext |
Throws | FacesException: 如果在执行请求处理生命周期的过程中抛出异常 |
Throws | NullPointerException:
如果 context 为 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 theFacesContext
instance associated with the current request.- Parameters:
context
- FacesContext for the request being processed- Throws:
FacesException
- if an exception is thrown during the execution of the request processing lifecycleNullPointerException
- ifcontext
isnull
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!