public class StrongCacheStorage extends java.lang.Object implements ConcurrentCacheStorage, CacheStorageWithGetSize
Map
. It holds a strong reference to all objects
it was passed, therefore prevents the cache from being purged during garbage collection. This class is always
thread-safe since 2.3.24, before that if we are running on Java 5 or later.Constructor and Description |
---|
StrongCacheStorage() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
java.lang.Object |
get(java.lang.Object key) |
int |
getSize()
Returns a close approximation of the number of cache entries.
|
boolean |
isConcurrent()
Always returns
true . |
void |
put(java.lang.Object key,
java.lang.Object value) |
void |
remove(java.lang.Object key) |
public boolean isConcurrent()
true
.isConcurrent
in interface ConcurrentCacheStorage
public java.lang.Object get(java.lang.Object key)
get
in interface CacheStorage
public void put(java.lang.Object key, java.lang.Object value)
put
in interface CacheStorage
public void remove(java.lang.Object key)
remove
in interface CacheStorage
public int getSize()
getSize
in interface CacheStorageWithGetSize
public void clear()
clear
in interface CacheStorage