oracle.adf.view.faces.webapp.wrapper
Class ContextWrapperFactory

java.lang.Object
  extended byoracle.adf.view.faces.webapp.wrapper.ContextWrapperFactory

public abstract class ContextWrapperFactory
extends java.lang.Object

This is a factory which returns the context wrapper. Whenever possible, this wrappers should be used instead of the native context objects in order to maintain compatibility with the Portal. These Wrapper's are intended to be used with (and not in place of) the FacesContext. These wrappers should be used only when the FacesContext is not available (i.e. in a filter) or when the FacesContext or ExternalContect does not provide some of the functionality which is needed by the renderkit.


Field Summary
static java.lang.String FACTORY_ATTRIB
          The attribute which will be used to cache an instance of this factory on the Context object
 
Constructor Summary
ContextWrapperFactory()
           
 
Method Summary
abstract  ContextWrapper getContext()
          Returns the appropriate ContextWrapper for the context provided in the constructor or taken from the FacesContext.
static ContextWrapperFactory getFactory()
          This returns a ContextWrapperFactory for the current FacesContext.
static ContextWrapperFactory getFactory(FacesContext fc)
          This returns a ContextWrapperFactory for the provided FacesContext.
static ContextWrapperFactory getFactory(java.lang.Object context)
          Returns the WrapperFactory for a given context, request, and response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY_ATTRIB

public static final java.lang.String FACTORY_ATTRIB
The attribute which will be used to cache an instance of this factory on the Context object

See Also:
Constant Field Values
Constructor Detail

ContextWrapperFactory

public ContextWrapperFactory()
Method Detail

getFactory

public static ContextWrapperFactory getFactory()
This returns a ContextWrapperFactory for the current FacesContext.

Returns:
a ContextWrapperFactory for the current FacesContext

getFactory

public static ContextWrapperFactory getFactory(FacesContext fc)
This returns a ContextWrapperFactory for the provided FacesContext.

Parameters:
fc - the FacesContext to get the WrapperFactory from
Returns:
a ContextWrapperFactory for the provided FacesContext

getFactory

public static ContextWrapperFactory getFactory(java.lang.Object context)
Returns the WrapperFactory for a given context, request, and response. The supported context, request, and response objects are those provided by the Servlet Specification and the JSR-168 Portlet specification. The request and response parameters may be null should they be unavailable. If this is the case then the getRequest and getResponse methods on the returned factory will return null. If request is provided, then the response should also be provided.

Parameters:
context - the current context
Returns:
a WrapperFactory for the current context, request, and response
Throws:
java.lang.RuntimeException - if the adf-faces-impl.jar is not available on the classpath

getContext

public abstract ContextWrapper getContext()
Returns the appropriate ContextWrapper for the context provided in the constructor or taken from the FacesContext. If the context was unable to be obtained when this factory was created, this may return a null.

Returns:
a ContextWrapper for the provided context or null


Copyright © 2003-2007 Oracle Corporation. All Rights Reserved.