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

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

public abstract class ContextWrapper
extends java.lang.Object

This class wraps a ServletContext or PortletContext object and provides the functionality needed by ADFFaces.


Constructor Summary
ContextWrapper()
           
 
Method Summary
abstract  java.lang.Object getContext()
          Returns the wrapped context object.
abstract  java.lang.String getInitParameter(java.lang.String name)
          Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.
 IOWrapperFactory getIOFactory()
          Returns an IOWrapperFactory for a request and a response within the current FacesContext.
abstract  IOWrapperFactory getIOFactory(java.lang.Object request, java.lang.Object response)
          Returns an IOWrapperFactory for a request and response item within this context.
abstract  java.util.Map getMap()
          Returns a mutable map of attributes.
abstract  java.io.InputStream getResourceAsStream(java.lang.String path)
          Returns the resource located at the named path as an InputStream object.
abstract  java.io.File getTempDir()
          Returns a file containing the temporary directory of the current container.
abstract  boolean isServletContext()
          Returns true is this is a ServletContext or false if it is a portlet context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextWrapper

public ContextWrapper()
Method Detail

getResourceAsStream

public abstract java.io.InputStream getResourceAsStream(java.lang.String path)
Returns the resource located at the named path as an InputStream object. The data in the InputStream can be of any type or length. The path must begin with a "/" and is interpreted as relative to the current context root. This method returns null if no resource exists at the specified path.

Parameters:
path - a String specifying the path to the resource
Returns:
the InputStream containing the resource or null if no resource exists at the specified path

getInitParameter

public abstract java.lang.String getInitParameter(java.lang.String name)
Returns a String containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.

Parameters:
name - a String containing the name of the parameter whose value is requested
Returns:
a String containing the value of the specified initialization parameter

getMap

public abstract java.util.Map getMap()
Returns a mutable map of attributes.

Returns:

getIOFactory

public IOWrapperFactory getIOFactory()
Returns an IOWrapperFactory for a request and a response within the current FacesContext. This is a bit faster then gerring the Factory via IOWrapperFactory's getFactory methos because it is assumed that the request and response provided by the faces context is of the appropriate type.

Returns:
a IOWrapperFactory for the request and response objects
Throws:
java.lang.IllegalArgumentException - when the request or response objects are not of the appropriate type.
java.lang.IllegalStateException - if there is no FacesContext currently established.

getIOFactory

public abstract IOWrapperFactory getIOFactory(java.lang.Object request,
                                              java.lang.Object response)
Returns an IOWrapperFactory for a request and response item within this context. This is a bit faster then getting the Factory via IOWrapperFactory's getFactory method because it is assumed that the provided request and response are of the appropriate type.

Parameters:
request - the request object
response - the response object
Returns:
a IOWrapperFactory for the request and response objects
Throws:
java.lang.IllegalArgumentException - when the request or response objects are not of the appropriate type.

getTempDir

public abstract java.io.File getTempDir()
Returns a file containing the temporary directory of the current container. For Servlet containers, this will be the value of the javax.servlet.context.tempdir attribute on the ServletContext. For the Portal, we'll first look on the PortletContext for the javax.servlet.context.tempdir attribute. If that is not available we'll create a temporary directory in the webapp's web-inf directory assuming we have permissions to write to this directory. If all else fails, this method will return null.

Returns:
a file handle to the temporary directory or null.

isServletContext

public abstract boolean isServletContext()
Returns true is this is a ServletContext or false if it is a portlet context.

Returns:
a boolean telling whether this is a servlet context or not

getContext

public abstract java.lang.Object getContext()
Returns the wrapped context object.

Returns:
the wrapped ServletContext or PortletContext object.


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