Interface CacheMap
- All Known Implementing Classes:
DefaultCacheMap
public interface CacheMap
Defines 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.
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
Modifier and TypeMethodDescriptionvoidclear()Removes all elements from map.booleanChecks if map contains value for key specified.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
-
Method Details
-
registerEvictionCallback
Notifies cache region when eviction occurs. -
get
Gets value associated with the key. Returns null when key does not exist. -
put
Puts new value into the map. Replaces old one. -
remove
Removes value from the map. -
contains
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
Collection<CacheKey> getAllKeys()Returns all keys currently stored in this map.
-