Spring Web Flow

org.springframework.webflow.context.portlet
Class PortletSessionMap

java.lang.Object
  extended by org.springframework.binding.collection.StringKeyedMapAdapter<java.lang.Object>
      extended by org.springframework.webflow.context.portlet.PortletSessionMap
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>, SharedMap<java.lang.String,java.lang.Object>

public class PortletSessionMap
extends StringKeyedMapAdapter<java.lang.Object>
implements SharedMap<java.lang.String,java.lang.Object>

A Shared Map backed by the Portlet session, for accessing session scoped attributes.

Author:
Keith Donald, Scott Andrews

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
PortletSessionMap(javax.portlet.PortletRequest request)
          Create a map wrapping the session of given request.
 
Method Summary
protected  java.lang.Object getAttribute(java.lang.String key)
          Hook method that needs to be implemented by concrete subclasses.
protected  java.util.Iterator<java.lang.String> getAttributeNames()
          Hook method that needs to be implemented by concrete subclasses.
 java.lang.Object getMutex()
          Returns the shared mutex that may be synchronized on using a synchronized block.
protected  void removeAttribute(java.lang.String key)
          Hook method that needs to be implemented by concrete subclasses.
protected  void setAttribute(java.lang.String key, java.lang.Object value)
          Hook method that needs to be implemented by concrete subclasses.
 
Methods inherited from class org.springframework.binding.collection.StringKeyedMapAdapter
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

PortletSessionMap

public PortletSessionMap(javax.portlet.PortletRequest request)
Create a map wrapping the session of given request.

Method Detail

getAttribute

protected java.lang.Object getAttribute(java.lang.String key)
Description copied from class: StringKeyedMapAdapter
Hook method that needs to be implemented by concrete subclasses. Gets a value associated with a key.

Specified by:
getAttribute in class StringKeyedMapAdapter<java.lang.Object>
Parameters:
key - the key to lookup
Returns:
the associated value, or null if none

setAttribute

protected void setAttribute(java.lang.String key,
                            java.lang.Object value)
Description copied from class: StringKeyedMapAdapter
Hook method that needs to be implemented by concrete subclasses. Puts a key-value pair in the map, overwriting any possible earlier value associated with the same key.

Specified by:
setAttribute in class StringKeyedMapAdapter<java.lang.Object>
Parameters:
key - the key to associate the value with
value - the value to associate with the key

removeAttribute

protected void removeAttribute(java.lang.String key)
Description copied from class: StringKeyedMapAdapter
Hook method that needs to be implemented by concrete subclasses. Removes a key and its associated value from the map.

Specified by:
removeAttribute in class StringKeyedMapAdapter<java.lang.Object>
Parameters:
key - the key to remove

getAttributeNames

protected java.util.Iterator<java.lang.String> getAttributeNames()
Description copied from class: StringKeyedMapAdapter
Hook method that needs to be implemented by concrete subclasses. Returns an enumeration listing all keys known to the map.

Specified by:
getAttributeNames in class StringKeyedMapAdapter<java.lang.Object>
Returns:
the key enumeration

getMutex

public java.lang.Object getMutex()
Description copied from interface: SharedMap
Returns the shared mutex that may be synchronized on using a synchronized block. The returned mutex is guaranteed to be non-null. Example usage:
 synchronized (sharedMap.getMutex()) {
        // do synchronized work
 }
 

Specified by:
getMutex in interface SharedMap<java.lang.String,java.lang.Object>
Returns:
the mutex

Spring Web Flow