Class PortletWebContext
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
,Context
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: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
- Author:
- Craig R. McClanahan
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map
The lazily instantiatedMap
of application scope attributes.protected javax.portlet.PortletContext
ThePortletContext
for this web application.private Map
The lazily instantiatedMap
of header name-value combinations (immutable).private Map
The lazily instantitatedMap
of header name-values combinations (immutable).private Map
The lazily instantiatedMap
of context initialization parameters.private Map
The lazily instantiatedMap
of request parameter name-value.private Map
The lazily instantiatedMap
of request parameter name-values.protected javax.portlet.PortletRequest
ThePortletRequest
for this request.private Map
The lazily instantiatedMap
of request scope attributes.protected javax.portlet.PortletResponse
ThePortletResponse
for this request.private Map
The lazily instantiatedMap
of session scope attributes. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an uninitializedPortletWebContext
instance.PortletWebContext
(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Construct aPortletWebContext
instance that is initialized with the specified Portlet API objects. -
Method Summary
Modifier and TypeMethodDescriptionSee theWebContext
's Javadoc.javax.portlet.PortletContext
Return thePortletContext
for this context.Returns an empty Map - portlets don't support Cookies.See theWebContext
's Javadoc.See theWebContext
's Javadoc.See theWebContext
's Javadoc.getParam()
See theWebContext
's Javadoc.See theWebContext
's Javadoc.javax.portlet.PortletRequest
Return thePortletRequest
for this context.See theWebContext
's Javadoc.javax.portlet.PortletResponse
Return thePortletResponse
for this context.See theWebContext
's Javadoc.void
initialize
(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Initialize (or reinitialize) thisPortletWebContext
instance for the specified Portlet API objects.void
release()
Release references to allocated resources acquired ininitialize()
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, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, getOrDefault, merge, newHashMap, putIfAbsent, remove, replace, replace, replaceAll, 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
compute, computeIfAbsent, computeIfPresent, containsKey, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
Field Details
-
applicationScope
The lazily instantiated
Map
of application scope attributes. -
context
protected javax.portlet.PortletContext contextThe
PortletContext
for this web application. -
header
The lazily instantiated
Map
of header name-value combinations (immutable). -
headerValues
The lazily instantitated
Map
of header name-values combinations (immutable). -
initParam
The lazily instantiated
Map
of context initialization parameters. -
param
The lazily instantiated
Map
of request parameter name-value. -
paramValues
The lazily instantiated
Map
of request parameter name-values. -
request
protected javax.portlet.PortletRequest requestThe
PortletRequest
for this request. -
requestScope
The lazily instantiated
Map
of request scope attributes. -
response
protected javax.portlet.PortletResponse responseThe
PortletResponse
for this request. -
sessionScope
The lazily instantiated
Map
of session scope attributes.
-
-
Constructor Details
-
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
- ThePortletContext
for this web applicationrequest
- ThePortletRequest
for this requestresponse
- ThePortletResponse
for this request
-
-
Method Details
-
getContext
public javax.portlet.PortletContext getContext()Return the
PortletContext
for this context.- Returns:
- The
PortletContext
for this request
-
getRequest
public javax.portlet.PortletRequest getRequest()Return the
PortletRequest
for this context.- Returns:
- The
PortletRequest
for this context.
-
getResponse
public javax.portlet.PortletResponse getResponse()Return the
PortletResponse
for this context.- Returns:
- 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
- ThePortletContext
for this web applicationrequest
- ThePortletRequest
for this requestresponse
- ThePortletResponse
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 thaninitialize()
will return undefined results. -
getApplicationScope
See theWebContext
's Javadoc.- Specified by:
getApplicationScope
in classWebContext
- Returns:
- Application scope Map.
-
getHeader
See theWebContext
's Javadoc.- Specified by:
getHeader
in classWebContext
- Returns:
- Header values Map.
-
getHeaderValues
See theWebContext
's Javadoc.- Specified by:
getHeaderValues
in classWebContext
- Returns:
- Header values Map.
-
getInitParam
See theWebContext
's Javadoc.- Specified by:
getInitParam
in classWebContext
- Returns:
- Initialization parameter Map.
-
getParam
See theWebContext
's Javadoc.- Specified by:
getParam
in classWebContext
- Returns:
- Request parameter Map.
-
getParamValues
See theWebContext
's Javadoc.- Specified by:
getParamValues
in classWebContext
- Returns:
- Request parameter Map.
-
getCookies
Returns an empty Map - portlets don't support Cookies.- Specified by:
getCookies
in classWebContext
- Returns:
- An empty Map.
- Since:
- Chain 1.1
-
getRequestScope
See theWebContext
's Javadoc.- Specified by:
getRequestScope
in classWebContext
- Returns:
- Request scope Map.
-
getSessionScope
See theWebContext
's Javadoc.- Specified by:
getSessionScope
in classWebContext
- Returns:
- Session scope Map.
-