Class HttpSessionMap

java.lang.Object
org.springframework.binding.collection.StringKeyedMapAdapter<Object>
org.springframework.webflow.context.servlet.HttpSessionMap
All Implemented Interfaces:
Map<String,Object>, SharedMap<String,Object>

public class HttpSessionMap extends StringKeyedMapAdapter<Object> implements SharedMap<String,Object>
A Shared Map backed by the Servlet HTTP session, for accessing session scoped attributes.
Author:
Keith Donald
  • Constructor Details

    • HttpSessionMap

      public HttpSessionMap(jakarta.servlet.http.HttpServletRequest request)
      Create a map wrapping the session of given request.
  • Method Details

    • getAttribute

      protected Object getAttribute(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<Object>
      Parameters:
      key - the key to lookup
      Returns:
      the associated value, or null if none
    • setAttribute

      protected void setAttribute(String key, 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<Object>
      Parameters:
      key - the key to associate the value with
      value - the value to associate with the key
    • removeAttribute

      protected void removeAttribute(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<Object>
      Parameters:
      key - the key to remove
    • getAttributeNames

      protected Iterator<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<Object>
      Returns:
      the key enumeration
    • getMutex

      public 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<String,Object>
      Returns:
      the mutex