Class UsageManagerCacheFilter

  • All Implemented Interfaces:
    Cache

    public class UsageManagerCacheFilter
    extends CacheFilter
    Simple CacheFilter that increases/decreases usage on a UsageManager as objects are added/removed from the Cache.
    • Constructor Detail

      • UsageManagerCacheFilter

        public UsageManagerCacheFilter​(Cache next,
                                       org.apache.activemq.usage.MemoryUsage um)
    • Method Detail

      • remove

        public Object remove​(Object key)
        Description copied from interface: Cache
        Removes an object from the cache.
        Specified by:
        remove in interface Cache
        Overrides:
        remove in class CacheFilter
        Returns:
        the object associated with the key if it was still in the cache.
      • getUsageOfAddedObject

        protected long getUsageOfAddedObject​(Object value)
      • getUsageOfRemovedObject

        protected long getUsageOfRemovedObject​(Object value)
      • close

        public void close()
        Description copied from interface: Cache
        Lets a cache know it will not be used any further and that it can release acquired resources
        Specified by:
        close in interface Cache
        Overrides:
        close in class CacheFilter