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 AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate MapThe lazily instantiatedMapof application scope attributes.protected javax.portlet.PortletContextThePortletContextfor this web application.private MapThe lazily instantiatedMapof header name-value combinations (immutable).private MapThe lazily instantitatedMapof header name-values combinations (immutable).private MapThe lazily instantiatedMapof context initialization parameters.private MapThe lazily instantiatedMapof request parameter name-value.private MapThe lazily instantiatedMapof request parameter name-values.protected javax.portlet.PortletRequestThePortletRequestfor this request.private MapThe lazily instantiatedMapof request scope attributes.protected javax.portlet.PortletResponseThePortletResponsefor this request.private MapThe lazily instantiatedMapof session scope attributes. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an uninitializedPortletWebContextinstance.PortletWebContext(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Construct aPortletWebContextinstance that is initialized with the specified Portlet API objects. -
Method Summary
Modifier and TypeMethodDescriptionSee theWebContext's Javadoc.javax.portlet.PortletContextReturn thePortletContextfor 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.PortletRequestReturn thePortletRequestfor this context.See theWebContext's Javadoc.javax.portlet.PortletResponseReturn thePortletResponsefor this context.See theWebContext's Javadoc.voidinitialize(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Initialize (or reinitialize) thisPortletWebContextinstance for the specified Portlet API objects.voidrelease()Release references to allocated resources acquired ininitialize()of via subsequent processing.Methods inherited from class ContextBase
clear, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, valuesMethods inherited from class HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, forEach, getOrDefault, merge, newHashMap, putIfAbsent, remove, replace, replace, replaceAll, sizeMethods inherited from class AbstractMap
equals, hashCode, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
Field Details
-
applicationScope
The lazily instantiated
Mapof application scope attributes. -
context
protected javax.portlet.PortletContext contextThe
PortletContextfor this web application. -
header
The lazily instantiated
Mapof header name-value combinations (immutable). -
headerValues
The lazily instantitated
Mapof header name-values combinations (immutable). -
initParam
The lazily instantiated
Mapof context initialization parameters. -
param
The lazily instantiated
Mapof request parameter name-value. -
paramValues
The lazily instantiated
Mapof request parameter name-values. -
request
protected javax.portlet.PortletRequest requestThe
PortletRequestfor this request. -
requestScope
The lazily instantiated
Mapof request scope attributes. -
response
protected javax.portlet.PortletResponse responseThe
PortletResponsefor this request. -
sessionScope
The lazily instantiated
Mapof session scope attributes.
-
-
Constructor Details
-
PortletWebContext
public PortletWebContext()Construct an uninitialized
PortletWebContextinstance. -
PortletWebContext
public PortletWebContext(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Construct a
PortletWebContextinstance that is initialized with the specified Portlet API objects.- Parameters:
context- ThePortletContextfor this web applicationrequest- ThePortletRequestfor this requestresponse- ThePortletResponsefor this request
-
-
Method Details
-
getContext
public javax.portlet.PortletContext getContext()Return the
PortletContextfor this context.- Returns:
- The
PortletContextfor this request
-
getRequest
public javax.portlet.PortletRequest getRequest()Return the
PortletRequestfor this context.- Returns:
- The
PortletRequestfor this context.
-
getResponse
public javax.portlet.PortletResponse getResponse()Return the
PortletResponsefor this context.- Returns:
- The
PortletResponsefor this context.
-
initialize
public void initialize(javax.portlet.PortletContext context, javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) Initialize (or reinitialize) this
PortletWebContextinstance for the specified Portlet API objects.- Parameters:
context- ThePortletContextfor this web applicationrequest- ThePortletRequestfor this requestresponse- ThePortletResponsefor 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:
getApplicationScopein classWebContext- Returns:
- Application scope Map.
-
getHeader
See theWebContext's Javadoc.- Specified by:
getHeaderin classWebContext- Returns:
- Header values Map.
-
getHeaderValues
See theWebContext's Javadoc.- Specified by:
getHeaderValuesin classWebContext- Returns:
- Header values Map.
-
getInitParam
See theWebContext's Javadoc.- Specified by:
getInitParamin classWebContext- Returns:
- Initialization parameter Map.
-
getParam
See theWebContext's Javadoc.- Specified by:
getParamin classWebContext- Returns:
- Request parameter Map.
-
getParamValues
See theWebContext's Javadoc.- Specified by:
getParamValuesin classWebContext- Returns:
- Request parameter Map.
-
getCookies
Returns an empty Map - portlets don't support Cookies.- Specified by:
getCookiesin classWebContext- Returns:
- An empty Map.
- Since:
- Chain 1.1
-
getRequestScope
See theWebContext's Javadoc.- Specified by:
getRequestScopein classWebContext- Returns:
- Request scope Map.
-
getSessionScope
See theWebContext's Javadoc.- Specified by:
getSessionScopein classWebContext- Returns:
- Session scope Map.
-