Class DefaultCacheMap
java.lang.Object
de.hybris.platform.regioncache.region.impl.DefaultCacheMap
- All Implemented Interfaces:
CacheMap
Default cache map implementation on the base of LinkedHashMap.
To be used together with DefaultCacheRegion. Implementation is not thread safe.
To be used together with DefaultCacheRegion. Implementation is not thread safe.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all elements from map.booleanChecks if map contains value for key specified.protected voidentryRemoved(Map.Entry<CacheKey, Object> eldest) Gets value associated with the key.Returns all keys currently stored in this map.longReturns max cache size above which eviction occurs.Puts new value into the map.voidregisterEvictionCallback(EvictionCallback callback) Notifies cache region when eviction occurs.Removes value from the map.longsize()Returns number of elements currently stored in the cache
-
Field Details
-
map
-
maxEntries
protected final int maxEntries -
callback
-
-
Constructor Details
-
DefaultCacheMap
public DefaultCacheMap(int maxEntries)
-
-
Method Details
-
registerEvictionCallback
Description copied from interface:CacheMapNotifies cache region when eviction occurs.- Specified by:
registerEvictionCallbackin interfaceCacheMap
-
get
Description copied from interface:CacheMapGets value associated with the key. Returns null when key does not exist. -
put
Description copied from interface:CacheMapPuts new value into the map. Replaces old one. -
remove
Description copied from interface:CacheMapRemoves value from the map. -
contains
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
Description copied from interface:CacheMapReturns all keys currently stored in this map.- Specified by:
getAllKeysin interfaceCacheMap
-
entryRemoved
-