org.activemq.io.util
Class MemoryBoundedObjectManager

java.lang.Object
  extended by org.activemq.capacity.BasicCapacityMonitor
      extended by org.activemq.io.util.MemoryBoundedObjectManager
All Implemented Interfaces:
CapacityMonitor

public class MemoryBoundedObjectManager
extends BasicCapacityMonitor

Keeps track of MemoryBoundedObjects

Version:
$Revision: 1.1.1.1 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.activemq.capacity.CapacityMonitor
CapacityMonitor.BasicCapacityMonitor
 
Constructor Summary
MemoryBoundedObjectManager(String name, long maxSize)
           
MemoryBoundedObjectManager(String name, long maxSize, boolean supportJMSPriority)
           
 
Method Summary
 void add(MemoryBoundedObject o)
           
 void close()
          close this queue manager and all associated MemoryBoundedQueues
 void decrementMemoryUsed(int size)
           
protected  void finalize()
           
 float getPercentFull()
           
 long getTotalMemoryUsedSize()
           
 void incrementMemoryUsed(int size)
           
 boolean isFull()
           
 boolean isSupportJMSPriority()
           
 void remove(MemoryBoundedObject o)
           
 void setSupportJMSPriority(boolean supportJMSPriority)
           
 
Methods inherited from class org.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

MemoryBoundedObjectManager

public MemoryBoundedObjectManager(String name,
                                  long maxSize)
Parameters:
name -
maxSize -

MemoryBoundedObjectManager

public MemoryBoundedObjectManager(String name,
                                  long maxSize,
                                  boolean supportJMSPriority)
Method Detail

add

public void add(MemoryBoundedObject o)

close

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


remove

public void remove(MemoryBoundedObject o)
Parameters:
name -

getTotalMemoryUsedSize

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

isFull

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

getPercentFull

public float getPercentFull()
Returns:
true if this MemoryBoundedObjectManager has reached it's predefined limit

incrementMemoryUsed

public void incrementMemoryUsed(int size)

decrementMemoryUsed

public void decrementMemoryUsed(int size)

finalize

protected void finalize()
Overrides:
finalize in class Object

isSupportJMSPriority

public boolean isSupportJMSPriority()
Returns:
Returns the supportJMSPriority.

setSupportJMSPriority

public void setSupportJMSPriority(boolean supportJMSPriority)
Parameters:
supportJMSPriority - The supportJMSPriority to set.


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