Package org.apache.activemq.memory
Class UsageManagerCacheFilter
java.lang.Object
org.apache.activemq.memory.CacheFilter
org.apache.activemq.memory.UsageManagerCacheFilter
- All Implemented Interfaces:
Cache
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
ConstructorsConstructorDescriptionUsageManagerCacheFilter(Cache next, org.apache.activemq.usage.MemoryUsage um) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Lets a cache know it will not be used any further and that it can release acquired resourcesprotected longgetUsageOfAddedObject(Object value) protected longgetUsageOfRemovedObject(Object value) Puts an object into the cache.Removes an object from the cache.Methods inherited from class org.apache.activemq.memory.CacheFilter
get, size
-
Constructor Details
-
UsageManagerCacheFilter
-
-
Method Details
-
put
Description copied from interface:CachePuts an object into the cache.- Specified by:
putin interfaceCache- Overrides:
putin classCacheFilter
-
remove
Description copied from interface:CacheRemoves an object from the cache.- Specified by:
removein interfaceCache- Overrides:
removein classCacheFilter- Returns:
- the object associated with the key if it was still in the cache.
-
getUsageOfAddedObject
-
getUsageOfRemovedObject
-
close
public void close()Description copied from interface:CacheLets a cache know it will not be used any further and that it can release acquired resources- Specified by:
closein interfaceCache- Overrides:
closein classCacheFilter
-