Class DefaultCacheMap
- java.lang.Object
-
- de.hybris.platform.regioncache.region.impl.DefaultCacheMap
-
-
Field Summary
Fields Modifier and Type Field Description protected EvictionCallbackcallbackprotected java.util.Map<CacheKey,java.lang.Object>mapprotected intmaxEntries
-
Constructor Summary
Constructors Constructor Description DefaultCacheMap(int maxEntries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all elements from map.booleancontains(CacheKey key)Checks if map contains value for key specified.protected voidentryRemoved(java.util.Map.Entry<CacheKey,java.lang.Object> eldest)java.lang.Objectget(CacheKey key)Gets value associated with the key.java.util.Collection<CacheKey>getAllKeys()Returns all keys currently stored in this map.longgetCacheMaxEntries()Returns max cache size above which eviction occurs.java.lang.Objectput(CacheKey key, java.lang.Object value)Puts new value into the map.voidregisterEvictionCallback(EvictionCallback callback)Notifies cache region when eviction occurs.java.lang.Objectremove(CacheKey key)Removes value from the map.longsize()Returns number of elements currently stored in the cache
-
-
-
Field Detail
-
map
protected final java.util.Map<CacheKey,java.lang.Object> map
-
maxEntries
protected final int maxEntries
-
callback
protected EvictionCallback callback
-
-
Method Detail
-
registerEvictionCallback
public void registerEvictionCallback(EvictionCallback callback)
Description copied from interface:CacheMapNotifies cache region when eviction occurs.- Specified by:
registerEvictionCallbackin interfaceCacheMap
-
get
public java.lang.Object get(CacheKey key)
Description copied from interface:CacheMapGets value associated with the key. Returns null when key does not exist.
-
put
public java.lang.Object put(CacheKey key, java.lang.Object value)
Description copied from interface:CacheMapPuts new value into the map. Replaces old one.
-
remove
public java.lang.Object remove(CacheKey key)
Description copied from interface:CacheMapRemoves value from the map.
-
contains
public boolean contains(CacheKey key)
Description copied from interface:CacheMapChecks if map contains value for key specified.
-
getCacheMaxEntries
public long getCacheMaxEntries()
Description copied from interface:CacheMapReturns max cache size above which eviction occurs.- Specified by:
getCacheMaxEntriesin interfaceCacheMap
-
clear
public void clear()
Description copied from interface:CacheMapRemoves all elements from map.
-
size
public long size()
Description copied from interface:CacheMapReturns number of elements currently stored in the cache
-
getAllKeys
public java.util.Collection<CacheKey> getAllKeys()
Description copied from interface:CacheMapReturns all keys currently stored in this map.- Specified by:
getAllKeysin interfaceCacheMap
-
entryRemoved
protected void entryRemoved(java.util.Map.Entry<CacheKey,java.lang.Object> eldest)
-
-