Class SharedMapDecorator<K,V>
java.lang.Object
org.springframework.binding.collection.SharedMapDecorator<K,V>
- All Implemented Interfaces:
Serializable
,Map<K,
,V> SharedMap<K,
V>
A map decorator that implements
SharedMap
. By default, simply returns the map itself as the mutex.
Subclasses may override to return a different mutex object.- Author:
- Keith Donald
- See Also:
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SharedMapDecorator
Creates a new shared map decorator.- Parameters:
map
- the map that is shared by multiple threads, to be synced
-
-
Method Details
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-
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 }
-
toString
-