org.apache.activemq.memory
Class UsageManagerCacheFilter

java.lang.Object
  extended by org.apache.activemq.memory.CacheFilter
      extended by org.apache.activemq.memory.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.


Field Summary
 
Fields inherited from class org.apache.activemq.memory.CacheFilter
next
 
Constructor Summary
UsageManagerCacheFilter(Cache next, MemoryUsage um)
           
 
Method Summary
 void close()
          Lets a cache know it will not be used any further and that it can release acquired resources
protected  long getUsageOfAddedObject(Object value)
           
protected  long getUsageOfRemovedObject(Object value)
           
 Object put(Object key, Object value)
          Puts an object into the cache.
 Object remove(Object key)
          Removes an object from the cache.
 
Methods inherited from class org.apache.activemq.memory.CacheFilter
get, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsageManagerCacheFilter

public UsageManagerCacheFilter(Cache next,
                               MemoryUsage um)
Method Detail

put

public Object put(Object key,
                  Object value)
Description copied from interface: Cache
Puts an object into the cache.

Specified by:
put in interface Cache
Overrides:
put in class CacheFilter

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


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.