org.codehaus.activemq.capacity
Interface CapacityMonitor

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

public interface CapacityMonitor

Fires CapacityChangedEvents

Version:
$Revision: 1.3 $

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

public String getName()
Get the name of the CapacityMonitor

Returns:
the name

setName

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

Parameters:
newName -

getRoundingFactor

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

Returns:
the rounding factor

setRoundingFactor

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

Parameters:
newRoundingFactor -

addCapacityEventListener

public void addCapacityEventListener(CapacityMonitorEventListener l)
Add a CapacityMonitorEventListener

Parameters:
l -

removeCapacityEventListener

public void removeCapacityEventListener(CapacityMonitorEventListener l)
Remove a CapacityMonitorEventListener

Parameters:
l -

getCurrentCapacity

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

Returns:

getRoundedCapacity

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

Returns:

getCurrentValue

public long getCurrentValue()
Get the current value of the CapacityMonitor

Returns:

setCurrentValue

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

Parameters:
newCurrentValue -

getValueLimit

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

setValueLimit

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

Parameters:
newValueLimit -


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