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.
  • Method Details

    • registerEvictionCallback

      void registerEvictionCallback(EvictionCallback callback)
      Notifies cache region when eviction occurs.
    • get

      Object get(CacheKey key)
      Gets value associated with the key. Returns null when key does not exist.
    • put

      Object put(CacheKey key, Object value)
      Puts new value into the map. Replaces old one.
    • remove

      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

      Collection<CacheKey> getAllKeys()
      Returns all keys currently stored in this map.