Top Description Fields Constructors Methods
javax.faces.context

public abstract Class ExternalContextFactory

extends Object
implements FacesWrapper<ExternalContextFactory>
Class Inheritance
All Implemented Interfaces
javax.faces.FacesWrapper
Known Direct Subclasses
com.sun.faces.context.ExternalContextFactoryImpl
Imports
javax.faces.FacesException, .FacesWrapper

ExternalContextFactory is a factory object that creates (if needed) and returns new ExternalContext instances, initialized for the processing of the specified request and response objects.

There must be one ExternalContextFactory instance per web application that is utilizing JavaServer Faces. This instance can be acquired, in a portable manner, by calling:

  ExternalContextFactory factory = (ExternalContextFactory)
   FactoryFinder.getFactory(FactoryFinder.EXTERNAL_CONTEXT_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
private ExternalContextFactory

Constructor Summary

AccessConstructor and Description
public
ExternalContextFactory()

Deprecated Use the other constructor taking the implementation being wrapped.
public
ExternalContextFactory(ExternalContextFactory
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 ExternalContext

Returns:

the instance of ExternalContext.
getExternalContext
(Object
In servlet environments, the ServletContext that is associated with this web application
context
,
Object
In servlet environments, the ServletRequest that is to be processed
request
,
Object
In servlet environments, the ServletResponse that is to be processed
response
)

Create (if needed) and return an ExternalContext instance that is initialized for the processing of the specified request and response objects, for this web application.

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

wrappedback to summary
private ExternalContextFactory wrapped

Constructor Detail

ExternalContextFactoryback to summary
public ExternalContextFactory()

Deprecated

Use the other constructor taking the implementation being wrapped.

Annotations
@Deprecated
ExternalContextFactoryback to summary
public ExternalContextFactory(ExternalContextFactory 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:ExternalContextFactory

The implementation being wrapped.

Method Detail

getExternalContextback to summary
public abstract ExternalContext getExternalContext(Object context, Object request, Object response) throws FacesException

Create (if needed) and return an ExternalContext instance that is initialized for the processing of the specified request and response objects, for this web application.

Parameters
context:Object

In servlet environments, the ServletContext that is associated with this web application

request:Object

In servlet environments, the ServletRequest that is to be processed

response:Object

In servlet environments, the ServletResponse that is to be processed

Returns:ExternalContext

the instance of ExternalContext.

Exceptions
FacesException:
if a ExternalContext cannot be constructed for the specified parameters
NullPointerException:
if any of the parameters are null
getWrappedback to summary
public ExternalContextFactory 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:ExternalContextFactory

Doc from javax.faces.FacesWrapper.getWrapped.

the wrapped instance.

Annotations
@Override
Since
2.0