Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.io.util
Class MemoryBoundedQueueManager  view MemoryBoundedQueueManager download MemoryBoundedQueueManager.java

java.lang.Object
  extended byorg.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 $

Field Summary
private  ConcurrentHashMap activeQueues
           
private  SynchronizedBoolean memoryLimitEnforced
           
private  MemoryBoundedObjectManager memoryManager
           
 
Constructor Summary
MemoryBoundedQueueManager(MemoryBoundedObjectManager memoryManager)
           
 
Method Summary
 void add(MemoryBoundedQueue queue)
           
 void close()
          close this queue manager and all associated MemoryBoundedQueues
 void decrementMemoryUsed(int size)
           
 java.lang.String dumpContents()
           
 int getCurrentCapacity()
           
 MemoryBoundedQueue getMemoryBoundedQueue(java.lang.String name)
          retrieve a named MemoryBoundedQueue or creates one if not found
 java.util.List getMemoryBoundedQueues()
           
 MemoryBoundedObjectManager getMemoryManager()
           
 void incrementMemoryUsed(int size)
           
 boolean isFull()
           
 boolean isMemoryLimitEnforced()
           
 void remove(MemoryBoundedQueue queue)
           
 void setMemoryLimitEnforced(boolean enable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activeQueues

private final ConcurrentHashMap activeQueues

memoryManager

private final MemoryBoundedObjectManager memoryManager

memoryLimitEnforced

private final SynchronizedBoolean memoryLimitEnforced
Constructor Detail

MemoryBoundedQueueManager

public MemoryBoundedQueueManager(MemoryBoundedObjectManager memoryManager)
Method Detail

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()