java.lang.Object
org.activemq.io.util.MemoryBoundedQueueManager
- public class MemoryBoundedQueueManager
- extends java.lang.Object
A factory manager for MemoryBoundedQueue and also ensures that the maximum memory used by all active
MemoryBoundedQueues created by this instance stays within the memory usage bounds set.
- Version:
- $Revision: 1.1.1.1 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
activeQueues
private final ConcurrentHashMap activeQueues
memoryManager
private final MemoryBoundedObjectManager memoryManager
memoryLimitEnforced
private final SynchronizedBoolean memoryLimitEnforced
MemoryBoundedQueueManager
public MemoryBoundedQueueManager(MemoryBoundedObjectManager memoryManager)
getMemoryBoundedQueue
public MemoryBoundedQueue getMemoryBoundedQueue(java.lang.String name)
- retrieve a named MemoryBoundedQueue or creates one if not found
close
public void close()
- close this queue manager and all associated MemoryBoundedQueues
getMemoryManager
public MemoryBoundedObjectManager getMemoryManager()
getCurrentCapacity
public int getCurrentCapacity()
add
public void add(MemoryBoundedQueue queue)
remove
public void remove(MemoryBoundedQueue queue)
isFull
public boolean isFull()
incrementMemoryUsed
public void incrementMemoryUsed(int size)
decrementMemoryUsed
public void decrementMemoryUsed(int size)
getMemoryBoundedQueues
public java.util.List getMemoryBoundedQueues()
dumpContents
public java.lang.String dumpContents()
setMemoryLimitEnforced
public void setMemoryLimitEnforced(boolean enable)
isMemoryLimitEnforced
public boolean isMemoryLimitEnforced()