org.codehaus.activemq.message.util
Class MemoryBoundedQueueManager

java.lang.Object
  extended byorg.codehaus.activemq.capacity.BasicCapacityMonitor
      extended byorg.codehaus.activemq.message.util.MemoryBoundedQueueManager
All Implemented Interfaces:
CapacityMonitor

public class MemoryBoundedQueueManager
extends BasicCapacityMonitor

A factory manager for MemoryBoundedQueue and also ensures that the maximum memory used by all active MemoryBoundedQueues cewated by this instance stays within the memory usage bounds set.

Version:
$Revision: 1.1 $

Nested Class Summary
 
Nested classes inherited from class org.codehaus.activemq.capacity.CapacityMonitor
CapacityMonitor.BasicCapacityMonitor
 
Constructor Summary
MemoryBoundedQueueManager(String name, long maxSize)
           
 
Method Summary
 void close()
          close this queue manager and all associated MemoryBoundedQueues
protected  void finalize()
           
 MemoryBoundedQueue getMemoryBoundedQueue(String name)
          retrieve a named MemoryBoundedQueue or creates one if not found
 long getTotalMemoryUsedSize()
           
 boolean isFull()
           
 
Methods inherited from class org.codehaus.activemq.capacity.BasicCapacityMonitor
addCapacityEventListener, generateCapacityMonitorEvent, getCurrentCapacity, getCurrentValue, getName, getRoundedCapacity, getRoundingFactor, getValueLimit, removeCapacityEventListener, setCurrentValue, setName, setRoundingFactor, setValueLimit
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryBoundedQueueManager

public MemoryBoundedQueueManager(String name,
                                 long maxSize)
Parameters:
name -
maxSize -
Method Detail

getMemoryBoundedQueue

public MemoryBoundedQueue getMemoryBoundedQueue(String name)
retrieve a named MemoryBoundedQueue or creates one if not found

Parameters:
name -
Returns:
an named instance of a MemoryBoundedQueue

close

public void close()
close this queue manager and all associated MemoryBoundedQueues


getTotalMemoryUsedSize

public long getTotalMemoryUsedSize()
Returns:
the calculated total memory usage assocated with all it's queues

isFull

public boolean isFull()
Returns:
true if this MemoryBoundedQueueManager has reached it's predefined limit

finalize

protected void finalize()


Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.