|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.faces.lifecycle Class LifecycleFactory
java.lang.Objectjavax.faces.lifecycle.LifecycleFactory
public abstract class LifecycleFactory
- extends Object
LifecycleFactory 是创建(如有需要)和返回 Lifecycle 实例的工厂对象。JavaServer Faces 实现必须至少提供一个默认的 Lifecycle 实现。高级实现(或外部第三方库)可以提供附加的 Lifecycle 实现(以生命周期标识符作为关键字),用于根据每个请求执行不同类型的请求处理。
每个利用 JavaServer Faces 的 Web 应用程序都必须有一个 LifecycleFactory 实例。可以通过可移植的方式获取此实例,即调用:
LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
LifecycleFactory is a factory object that creates
(if needed) and returns Lifecycle instances. Implementations of
JavaServer Faces must provide at least a default implementation of
Lifecycle. Advanced implementations (or external third party
libraries) MAY provide additional Lifecycle implementations
(keyed by lifecycle identifiers) for performing different types of
request processing on a per-request basis.
There must be one LifecycleFactory instance per web
application that is utilizing JavaServer Faces. This instance can be
acquired, in a portable manner, by calling:
LifecycleFactory factory = (LifecycleFactory)
FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
| Field Summary | |
|---|---|
static String |
DEFAULT_LIFECYCLE
The lifecycle identifier for the default Lifecycle instance
for this JavaServer Faces implementation. |
| Constructor Summary | |
|---|---|
LifecycleFactory()
|
|
| Method Summary | |
|---|---|
abstract void |
addLifecycle(String lifecycleId,
Lifecycle lifecycle)
Register a new Lifecycle instance, associated with
the specified lifecycleId, to be supported by this
LifecycleFactory. |
abstract Lifecycle |
getLifecycle(String lifecycleId)
Create (if needed) and return a Lifecycle instance
for the specified lifecycle identifier. |
abstract Iterator<String> |
getLifecycleIds()
Return an Iterator over the set of lifecycle
identifiers supported by this factory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
英文文档:
DEFAULT_LIFECYCLE
public static final String DEFAULT_LIFECYCLE
The lifecycle identifier for the default
Lifecycleinstance for this JavaServer Faces implementation.- See Also:
- Constant Field Values
| Constructor Detail |
|---|
public
LifecycleFactory()
英文文档:
LifecycleFactory
public LifecycleFactory()
| Method Detail |
|---|
abstract public void
addLifecycle(String lifecycleId, Lifecycle lifecycle)
注册与指定 lifecycleId 关联的新 Lifecycle 实例,以便此 LifecycleFactory 为其提供支持。此方法可以在任意时间调用,并使相应的 Lifecycle 实例在此 Web 应用程序剩余的生命周期内一直可用。
| lifecycleId |
新 Lifecycle 的标识符 |
| lifecycle |
要注册的 Lifecycle 实例 |
| Throws | IllegalArgumentException:
如果已经注册了带有指定 lifecycleId 的 Lifecycle |
| Throws | NullPointerException:
如果 lifecycleId 或 lifecycle 为 null |
addLifecycle
public abstract void addLifecycle(String lifecycleId, Lifecycle lifecycle)
Register a new
Lifecycleinstance, associated with the specifiedlifecycleId, to be supported by thisLifecycleFactory. This method may be called at any time, and makes the correspondingLifecycleinstance available throughout the remaining lifetime of this web application.- Parameters:
lifecycleId- Identifier of the newLifecyclelifecycle-Lifecycleinstance that we are registering- Throws:
IllegalArgumentException- if aLifecyclewith the specifiedlifecycleIdhas already been registeredNullPointerException- iflifecycleIdorlifecycleisnull
abstract public Lifecycle
getLifecycle(String lifecycleId)
为指定的生命周期标识符创建(如有需要)并返回 Lifecycle 实例。通过 getLifecycleIds() 方法可以获得可用生命周期标识符集合。
每次对同一个 Web 应用程序中的相同 lifecycleId 调用 getLifecycle() 都必须返回相同的 Lifecycle 实例。
| lifecycleId |
请求的 Lifecycle 实例的生命周期标识符 |
| Throws | IllegalArgumentException:
如果对于指定的标识符没有任何可以返回的 Lifecycle 实例 |
| Throws | NullPointerException:
如果 lifecycleId 为 null |
getLifecycle
public abstract Lifecycle getLifecycle(String lifecycleId)
Create (if needed) and return a
Lifecycleinstance for the specified lifecycle identifier. The set of available lifecycle identifiers is available via thegetLifecycleIds()method.Each call to
getLifecycle()for the samelifecycleId, from within the same web application, must return the sameLifecycleinstance.- Parameters:
lifecycleId- Lifecycle identifier of the requestedLifecycleinstance- Throws:
IllegalArgumentException- if noLifecycleinstance can be returned for the specified identifierNullPointerException- iflifecycleIdisnull
abstract public java.util.Iterator<E>
getLifecycleIds()
返回一个对此工厂支持的生命周期标识符集合进行迭代的 Iterator。此集合必须包括 LifecycleFactory.DEFAULT_LIFECYCLE 指定的值。
getLifecycleIds
public abstract Iterator<String> getLifecycleIds()
Return an
Iteratorover the set of lifecycle identifiers supported by this factory. This set must include the value specified byLifecycleFactory.DEFAULT_LIFECYCLE.
|
|
|||||||||
| 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 : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!
javax.faces.lifecycle.LifecycleFactory