Class DefaultCacheMap

java.lang.Object
de.hybris.platform.regioncache.region.impl.DefaultCacheMap
All Implemented Interfaces:
CacheMap

public class DefaultCacheMap extends Object implements CacheMap
Default cache map implementation on the base of LinkedHashMap.
To be used together with DefaultCacheRegion. Implementation is not thread safe.
  • Field Details

  • Constructor Details

    • DefaultCacheMap

      public DefaultCacheMap(int maxEntries)
  • Method Details

    • registerEvictionCallback

      public void registerEvictionCallback(EvictionCallback callback)
      Description copied from interface: CacheMap
      Notifies cache region when eviction occurs.
      Specified by:
      registerEvictionCallback in interface CacheMap
    • get

      public Object get(CacheKey key)
      Description copied from interface: CacheMap
      Gets value associated with the key. Returns null when key does not exist.
      Specified by:
      get in interface CacheMap
    • put

      public Object put(CacheKey key, Object value)
      Description copied from interface: CacheMap
      Puts new value into the map. Replaces old one.
      Specified by:
      put in interface CacheMap
    • remove

      public Object remove(CacheKey key)
      Description copied from interface: CacheMap
      Removes value from the map.
      Specified by:
      remove in interface CacheMap
    • contains

      public boolean contains(CacheKey key)
      Description copied from interface: CacheMap
      Checks if map contains value for key specified.
      Specified by:
      contains in interface CacheMap
    • getCacheMaxEntries

      public long getCacheMaxEntries()
      Description copied from interface: CacheMap
      Returns max cache size above which eviction occurs.
      Specified by:
      getCacheMaxEntries in interface CacheMap
    • clear

      public void clear()
      Description copied from interface: CacheMap
      Removes all elements from map.
      Specified by:
      clear in interface CacheMap
    • size

      public long size()
      Description copied from interface: CacheMap
      Returns number of elements currently stored in the cache
      Specified by:
      size in interface CacheMap
    • getAllKeys

      public Collection<CacheKey> getAllKeys()
      Description copied from interface: CacheMap
      Returns all keys currently stored in this map.
      Specified by:
      getAllKeys in interface CacheMap
    • entryRemoved

      protected void entryRemoved(Map.Entry<CacheKey,Object> eldest)