|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- V
- public interface HeapCacheBackEnd<K,V>
A backend to a OnHeapCachingTier
It's responsibility, beyond being the actual storage (CHM
like),
is to evict when required.
ConcurrentHashMap
Nested Class Summary | |
---|---|
static interface |
HeapCacheBackEnd.EvictionCallback<K,V>
An eviction callback |
Method Summary | |
---|---|
void |
clear(boolean notify)
Basically CHM.clear() |
Set<Map.Entry<K,V>> |
entrySet()
Deprecated. |
V |
get(K key)
Access a key, basically CHM.get() |
Policy |
getPolicy()
Deprecated. |
boolean |
hasSpace()
Return true if this tier has enough space for more entries. |
V |
putIfAbsent(K key,
V value)
Basically ConcurrentMap.putIfAbsent(Object, Object) CHM.putIfAbsent(Object, Object)}, but
will evict if required (on successful put) |
void |
recalculateSize(K key)
Deprecated. |
void |
registerEvictionCallback(HeapCacheBackEnd.EvictionCallback<K,V> callback)
Let's you register a single callback for evictions |
V |
remove(K key)
Basically CHM.remove(Object) |
boolean |
remove(K key,
V value)
Basically ConcurrentMap.remove(Object, Object) CHM.remove(Object, Object)} |
boolean |
replace(K key,
V oldValue,
V newValue)
Basically CHM.remove(Object, Object, Object) |
void |
setPolicy(Policy policy)
Deprecated. |
int |
size()
Deprecated. |
Method Detail |
---|
boolean hasSpace()
true
if this tier has enough space for more entries.
true
if there is space for more entries.V get(K key)
CHM.get()
key
- the key whose associated value is to be returned
null
if this map contains no mapping for the keyV putIfAbsent(K key, V value)
ConcurrentMap.putIfAbsent(Object, Object)
CHM.putIfAbsent(Object, Object)}, but
will evict if required (on successful put)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
boolean remove(K key, V value)
ConcurrentMap.remove(Object, Object)
CHM.remove(Object, Object)}
key
- key with which the specified value is associatedvalue
- value expected to be associated with the specified key
boolean replace(K key, V oldValue, V newValue)
CHM.remove(Object, Object, Object)
key
- key with which the specified value is associatedoldValue
- value expected to be associated with the specified keynewValue
- value to be associated with the specified key
V remove(K key)
CHM.remove(Object)
key
- key whose mapping is to be removed from the map
void clear(boolean notify)
CHM.clear()
notify
- whether to notify listeners or not@Deprecated int size()
@Deprecated Set<Map.Entry<K,V>> entrySet()
void registerEvictionCallback(HeapCacheBackEnd.EvictionCallback<K,V> callback)
callback
- the thing to call back on@Deprecated void recalculateSize(K key)
key
- @Deprecated Policy getPolicy()
@Deprecated void setPolicy(Policy policy)
policy
- the policy to use
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |