org.apache.commons.chain.web.portlet
Class PortletWebContext

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.apache.commons.chain.impl.ContextBase
              extended byorg.apache.commons.chain.web.WebContext
                  extended byorg.apache.commons.chain.web.portlet.PortletWebContext
All Implemented Interfaces:
Cloneable, Context, Map, Serializable

public class PortletWebContext
extends WebContext

Concrete implementation of WebContext suitable for use in portlets. The abstract methods are mapped to the appropriate collections of the underlying portlet context, request, and response instances that are passed to the constructor (or the initialize method).

Version:
$Revision: 1.6 $ $Date: 2004/02/25 00:01:06 $
Author:
Craig R. McClanahan
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
protected  javax.portlet.PortletContext context
          The PortletContext for this web application.
protected  javax.portlet.PortletRequest request
          The PortletRequest for this request.
protected  javax.portlet.PortletResponse response
          The PortletResponse for this request.
 
Constructor Summary
PortletWebContext()
          Construct an uninitialized PortletWebContext instance.
PortletWebContext(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
          Construct a PortletWebContext instance that is initialized with the specified Portlet API objects.
 
Method Summary
 Map getApplicationScope()
          Return a mutable Map that maps application scope attribute names to their values.
 javax.portlet.PortletContext getContext()
          Return the PortletContext for this context.
 Map getHeader()
          Return an immutable Map that maps header names to the first (or only) header value (as a String).
 Map getHeaderValues()
          Return an immutable Map that maps header names to the set of all values specified in the request (as a String array).
 Map getInitParam()
          Return an immutable Map that maps context application initialization parameters to their values.
 Map getParam()
          Return an immutable Map that maps request parameter names to the first (or only) value (as a String).
 Map getParamValues()
          Return an immutable Map that maps request parameter names to the set of all values (as a String array).
 javax.portlet.PortletRequest getRequest()
          Return the PortletRequest for this context.
 Map getRequestScope()
          Return a mutable Map that maps request scope attribute names to their values.
 javax.portlet.PortletResponse getResponse()
          Return the PortletResponse for this context.
 Map getSessionScope()
          Return a mutable Map that maps session scope attribute names to their values.
 void initialize(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)
          Initialize (or reinitialize) this PortletWebContext instance for the specified Portlet API objects.
 void release()
          Release references to allocated resources acquired in initialize() of via subsequent processing.
 
Methods inherited from class org.apache.commons.chain.impl.ContextBase
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, values
 
Methods inherited from class java.util.HashMap
clone, containsKey, size
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, equals, hashCode, size
 

Field Detail

context

protected javax.portlet.PortletContext context

The PortletContext for this web application.


request

protected javax.portlet.PortletRequest request

The PortletRequest for this request.


response

protected javax.portlet.PortletResponse response

The PortletResponse for this request.

Constructor Detail

PortletWebContext

public PortletWebContext()

Construct an uninitialized PortletWebContext instance.


PortletWebContext

public PortletWebContext(javax.portlet.PortletContext context,
                         javax.portlet.PortletRequest request,
                         javax.portlet.PortletResponse response)

Construct a PortletWebContext instance that is initialized with the specified Portlet API objects.

Parameters:
context - The PortletContext for this web application
request - The PortletRequest for this request
response - The PortletResponse for this request
Method Detail

getContext

public javax.portlet.PortletContext getContext()

Return the PortletContext for this context.


getRequest

public javax.portlet.PortletRequest getRequest()

Return the PortletRequest for this context.


getResponse

public javax.portlet.PortletResponse getResponse()

Return the PortletResponse for this context.


initialize

public void initialize(javax.portlet.PortletContext context,
                       javax.portlet.PortletRequest request,
                       javax.portlet.PortletResponse response)

Initialize (or reinitialize) this PortletWebContext instance for the specified Portlet API objects.

Parameters:
context - The PortletContext for this web application
request - The PortletRequest for this request
response - The PortletResponse for this request

release

public void release()

Release references to allocated resources acquired in initialize() of via subsequent processing. After this method is called, subsequent calls to any other method than initialize() will return undefined results.


getApplicationScope

public Map getApplicationScope()
Description copied from class: WebContext

Return a mutable Map that maps application scope attribute names to their values.

Specified by:
getApplicationScope in class WebContext

getHeader

public Map getHeader()
Description copied from class: WebContext

Return an immutable Map that maps header names to the first (or only) header value (as a String). Header names must be matched in a case-insensitive manner.

Specified by:
getHeader in class WebContext

getHeaderValues

public Map getHeaderValues()
Description copied from class: WebContext

Return an immutable Map that maps header names to the set of all values specified in the request (as a String array). Header names must be matched in a case-insensitive manner.

Specified by:
getHeaderValues in class WebContext

getInitParam

public Map getInitParam()
Description copied from class: WebContext

Return an immutable Map that maps context application initialization parameters to their values.

Specified by:
getInitParam in class WebContext

getParam

public Map getParam()
Description copied from class: WebContext

Return an immutable Map that maps request parameter names to the first (or only) value (as a String).

Specified by:
getParam in class WebContext

getParamValues

public Map getParamValues()
Description copied from class: WebContext

Return an immutable Map that maps request parameter names to the set of all values (as a String array).

Specified by:
getParamValues in class WebContext

getRequestScope

public Map getRequestScope()
Description copied from class: WebContext

Return a mutable Map that maps request scope attribute names to their values.

Specified by:
getRequestScope in class WebContext

getSessionScope

public Map getSessionScope()
Description copied from class: WebContext

Return a mutable Map that maps session scope attribute names to their values.

Specified by:
getSessionScope in class WebContext


Copyright © 2003-2005 The Apache Software Foundation. All Rights Reserved.