Class WeakIdentityConcurrentMap<K,V>
java.lang.Object
org.ehcache.sizeof.util.WeakIdentityConcurrentMap<K,V>
- Type Parameters:
K- The key typeV- The value type
A poor man's implementation of a WeakIdentityConcurrentMap to hold the CacheManager associated ExecutorServices
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WeakIdentityConcurrentMap.CleanUpTask<V> private final ConcurrentMap<WeakReference<K>, V> private final ReferenceQueue<K> -
Constructor Summary
ConstructorsConstructorDescriptionConstructorWeakIdentityConcurrentMap(WeakIdentityConcurrentMap.CleanUpTask<V> cleanUpTask) Constructor -
Method Summary
-
Field Details
-
map
-
queue
-
cleanUpTask
-
-
Constructor Details
-
WeakIdentityConcurrentMap
public WeakIdentityConcurrentMap()Constructor -
WeakIdentityConcurrentMap
Constructor- Parameters:
cleanUpTask- task cleaning up references
-
-
Method Details
-
put
Puts into the underlying- Parameters:
key- key with which the specified value is to be associatedvalue- value to be associated with the specified key- Returns:
- the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)
-
remove
-
toString
-
putIfAbsent
Puts into the underlying- Parameters:
key- key with which the specified value is to be associatedvalue- value to be associated with the specified key- Returns:
- the previous value associated with the specified key, or
nullif there was no mapping for the key. (Anullreturn can also indicate that the map previously associatednullwith the key, if the implementation supports null values.)
-
get
-
cleanUp
public void cleanUp() -
keySet
-
containsKey
-