Top Description Fields Constructors Methods
javax.faces.lifecycle

public abstract Class LifecycleFactory

extends Object
implements FacesWrapper<LifecycleFactory>
Class Inheritance
All Implemented Interfaces
javax.faces.FacesWrapper
Known Direct Subclasses
com.sun.faces.lifecycle.LifecycleFactoryImpl
Imports
java.util.Iterator, javax.faces.FacesWrapper

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);

Usage: extend this class and push the implementation being wrapped to the constructor and use getWrapped to access the instance being wrapped.

Field Summary

Modifier and TypeField and Description
public static final String
DEFAULT_LIFECYCLE

The lifecycle identifier for the default Lifecycle instance for this JavaServer Faces implementation.

private LifecycleFactory

Constructor Summary

AccessConstructor and Description
public
LifecycleFactory()

Deprecated Use the other constructor taking the implementation being wrapped.
public
LifecycleFactory(LifecycleFactory
The implementation being wrapped.
wrapped
)

If this factory has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor.

Method Summary

Modifier and TypeMethod and Description
public abstract void
addLifecycle(String
Identifier of the new Lifecycle
lifecycleId
,
Lifecycle
Lifecycle instance that we are registering
lifecycle
)

Register a new Lifecycle instance, associated with the specified lifecycleId, to be supported by this LifecycleFactory.

public abstract Lifecycle

Returns:

the Lifecycle instance
getLifecycle
(String
Lifecycle identifier of the requested Lifecycle instance
lifecycleId
)

Create (if needed) and return a Lifecycle instance for the specified lifecycle identifier.

public abstract Iterator<String>

Returns:

an Iterator over the set of lifecycle identifiers supported by this factory
getLifecycleIds
()

Return an Iterator over the set of lifecycle identifiers supported by this factory.

public LifecycleFactory
getWrapped()

Implements javax.faces.FacesWrapper.getWrapped.

If this factory has been decorated, the implementation doing the decorating may override this method to provide access to the implementation being wrapped.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_LIFECYCLEback to summary
public static final String DEFAULT_LIFECYCLE

The lifecycle identifier for the default Lifecycle instance for this JavaServer Faces implementation.

wrappedback to summary
private LifecycleFactory wrapped

Constructor Detail

LifecycleFactoryback to summary
public LifecycleFactory()

Deprecated

Use the other constructor taking the implementation being wrapped.

Annotations
@Deprecated
LifecycleFactoryback to summary
public LifecycleFactory(LifecycleFactory wrapped)

If this factory has been decorated, the implementation doing the decorating should push the implementation being wrapped to this constructor. The getWrapped() will then return the implementation being wrapped.

Parameters
wrapped:LifecycleFactory

The implementation being wrapped.

Method Detail

addLifecycleback to summary
public abstract void addLifecycle(String lifecycleId, Lifecycle lifecycle)

Register a new Lifecycle instance, associated with the specified lifecycleId, to be supported by this LifecycleFactory. This method may be called at any time, and makes the corresponding Lifecycle instance available throughout the remaining lifetime of this web application.

Parameters
lifecycleId:String

Identifier of the new Lifecycle

lifecycle:Lifecycle

Lifecycle instance that we are registering

Exceptions
IllegalArgumentException:
if a Lifecycle with the specified lifecycleId has already been registered
NullPointerException:
if lifecycleId or lifecycle is null
getLifecycleback to summary
public abstract Lifecycle getLifecycle(String lifecycleId)

Create (if needed) and return a Lifecycle instance for the specified lifecycle identifier. The set of available lifecycle identifiers is available via the getLifecycleIds() method.

Each call to getLifecycle() for the same lifecycleId, from within the same web application, must return the same Lifecycle instance.

Parameters
lifecycleId:String

Lifecycle identifier of the requested Lifecycle instance

Returns:Lifecycle

the Lifecycle instance

Exceptions
IllegalArgumentException:
if no Lifecycle instance can be returned for the specified identifier
NullPointerException:
if lifecycleId is null
getLifecycleIdsback to summary
public abstract Iterator<String> getLifecycleIds()

Return an Iterator over the set of lifecycle identifiers supported by this factory. This set must include the value specified by LifecycleFactory.DEFAULT_LIFECYCLE.

Returns:Iterator<String>

an Iterator over the set of lifecycle identifiers supported by this factory

getWrappedback to summary
public LifecycleFactory getWrapped()

Implements javax.faces.FacesWrapper.getWrapped.

If this factory has been decorated, the implementation doing the decorating may override this method to provide access to the implementation being wrapped.

Returns:LifecycleFactory

Doc from javax.faces.FacesWrapper.getWrapped.

the wrapped instance.

Annotations
@Override
Since
2.0