org.activemq.capacity
Interface CapacityMonitor

All Known Subinterfaces:
Broker
All Known Implementing Classes:
BasicCapacityMonitor, DefaultBroker, DelegateCapacityMonitor, MemoryBoundedObjectManager

public interface CapacityMonitor

Fires CapacityChangedEvents

Version:
$Revision: 1.1.1.1 $

Nested Class Summary
static class CapacityMonitor.BasicCapacityMonitor
          A CapacityMonitor holds percentage values for some resource that has a capacity - e.g.
 
Method Summary
 void addCapacityEventListener(CapacityMonitorEventListener l)
          Add a CapacityMonitorEventListener
 CapacityMonitorEvent generateCapacityMonitorEvent()
           
 int getCurrentCapacity()
          Get the current capacity of the service as a percentage
 long getCurrentValue()
          Get the current value of the CapacityMonitor
 String getName()
          Get the name of the CapacityMonitor
 int getRoundedCapacity()
          Calculates the capacity rounded down to the rounding factor
 int getRoundingFactor()
          Get the rounding factor - default is 10
 long getValueLimit()
           
 void removeCapacityEventListener(CapacityMonitorEventListener l)
          Remove a CapacityMonitorEventListener
 void setCurrentValue(long newCurrentValue)
          set the current value of the capacity
 void setName(String newName)
          Set the name of the CapacityMonitor
 void setRoundingFactor(int newRoundingFactor)
          Set the rounding factor (between 1-100)
 void setValueLimit(long newValueLimit)
          set a new value limit for the CapacityMonitor
 

Method Detail

getName

String getName()
Get the name of the CapacityMonitor

Returns:
the name

setName

void setName(String newName)
Set the name of the CapacityMonitor

Parameters:
newName -

getRoundingFactor

int getRoundingFactor()
Get the rounding factor - default is 10

Returns:
the rounding factor

setRoundingFactor

void setRoundingFactor(int newRoundingFactor)
Set the rounding factor (between 1-100)

Parameters:
newRoundingFactor -

addCapacityEventListener

void addCapacityEventListener(CapacityMonitorEventListener l)
Add a CapacityMonitorEventListener

Parameters:
l -

removeCapacityEventListener

void removeCapacityEventListener(CapacityMonitorEventListener l)
Remove a CapacityMonitorEventListener

Parameters:
l -

getCurrentCapacity

int getCurrentCapacity()
Get the current capacity of the service as a percentage

Returns:

getRoundedCapacity

int getRoundedCapacity()
Calculates the capacity rounded down to the rounding factor

Returns:

getCurrentValue

long getCurrentValue()
Get the current value of the CapacityMonitor

Returns:

setCurrentValue

void setCurrentValue(long newCurrentValue)
set the current value of the capacity

Parameters:
newCurrentValue -

getValueLimit

long getValueLimit()
Returns:
The upper limit of the value of the CapacityMonitor

setValueLimit

void setValueLimit(long newValueLimit)
set a new value limit for the CapacityMonitor

Parameters:
newValueLimit -

generateCapacityMonitorEvent

CapacityMonitorEvent generateCapacityMonitorEvent()
Returns:
a CapacityMontorEvent for the currentCapacity


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