Class HttpSessionMap
java.lang.Object
org.springframework.binding.collection.StringKeyedMapAdapter<Object>
org.springframework.webflow.context.servlet.HttpSessionMap
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
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHttpSessionMap(jakarta.servlet.http.HttpServletRequest request) Create a map wrapping the session of given request. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectgetAttribute(String key) Hook method that needs to be implemented by concrete subclasses.Hook method that needs to be implemented by concrete subclasses.getMutex()Returns the shared mutex that may be synchronized on using a synchronized block.protected voidremoveAttribute(String key) Hook method that needs to be implemented by concrete subclasses.protected voidsetAttribute(String key, 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, valuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
HttpSessionMap
public HttpSessionMap(jakarta.servlet.http.HttpServletRequest request) Create a map wrapping the session of given request.
-
-
Method Details
-
getAttribute
Description copied from class:StringKeyedMapAdapterHook method that needs to be implemented by concrete subclasses. Gets a value associated with a key.- Specified by:
getAttributein classStringKeyedMapAdapter<Object>- Parameters:
key- the key to lookup- Returns:
- the associated value, or null if none
-
setAttribute
Description copied from class:StringKeyedMapAdapterHook 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:
setAttributein classStringKeyedMapAdapter<Object>- Parameters:
key- the key to associate the value withvalue- the value to associate with the key
-
removeAttribute
Description copied from class:StringKeyedMapAdapterHook method that needs to be implemented by concrete subclasses. Removes a key and its associated value from the map.- Specified by:
removeAttributein classStringKeyedMapAdapter<Object>- Parameters:
key- the key to remove
-
getAttributeNames
Description copied from class:StringKeyedMapAdapterHook method that needs to be implemented by concrete subclasses. Returns an enumeration listing all keys known to the map.- Specified by:
getAttributeNamesin classStringKeyedMapAdapter<Object>- Returns:
- the key enumeration
-
getMutex
Description copied from interface:SharedMapReturns 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 }
-