Interface CacheMap
-
- All Known Implementing Classes:
DefaultCacheMap
public interface CacheMapDefines replaceable cache map interface to be used in hybris 5.
It is possible to configure DefaultCacheRegion together with custom map implementation. Nevertheless it is recommended to define whole CacheRegion.
This implementation should not be thread safe. Thread safety and synchronization is of the CacheRegion responsibility.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Removes all elements from map.booleancontains(CacheKey key)Checks if map contains value for key specified.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
-
-
-
Method Detail
-
registerEvictionCallback
void registerEvictionCallback(EvictionCallback callback)
Notifies cache region when eviction occurs.
-
get
java.lang.Object get(CacheKey key)
Gets value associated with the key. Returns null when key does not exist.
-
put
java.lang.Object put(CacheKey key, java.lang.Object value)
Puts new value into the map. Replaces old one.
-
remove
java.lang.Object remove(CacheKey key)
Removes value from the map.
-
contains
boolean contains(CacheKey key)
Checks if map contains value for key specified.
-
getCacheMaxEntries
long getCacheMaxEntries()
Returns max cache size above which eviction occurs.
-
clear
void clear()
Removes all elements from map.
-
size
long size()
Returns number of elements currently stored in the cache
-
getAllKeys
java.util.Collection<CacheKey> getAllKeys()
Returns all keys currently stored in this map.
-
-