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

Quick Search    Search Deep

org.activemq.capacity
Class DelegateCapacityMonitor  view DelegateCapacityMonitor download DelegateCapacityMonitor.java

java.lang.Object
  extended byorg.activemq.capacity.DelegateCapacityMonitor
All Implemented Interfaces:
CapacityMonitor

public class DelegateCapacityMonitor
extends java.lang.Object
implements CapacityMonitor

BasicCapacityMonitor implementation

Version:
$Revision: 1.1.1.1 $

Nested Class Summary
 
Nested classes inherited from class org.activemq.capacity.CapacityMonitor
CapacityMonitor.BasicCapacityMonitor
 
Field Summary
(package private)  CopyOnWriteArrayList listeners
           
(package private)  CapacityMonitor monitor
           
(package private)  java.lang.String name
           
 
Constructor Summary
DelegateCapacityMonitor()
          Construct a DelegateCapacityMonitor
DelegateCapacityMonitor(java.lang.String name, CapacityMonitor cm)
          Construct a DelegateCapacityMonitor
 
Method Summary
 void addCapacityEventListener(CapacityMonitorEventListener l)
          Add a CapacityEventListener
 CapacityMonitorEvent generateCapacityMonitorEvent()
           
 int getCurrentCapacity()
          Get the current capscity of the service as a percentage
 long getCurrentValue()
          Get the current value of the CapacityMonitor
 java.lang.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 CapacityEventListener
 void setCurrentValue(long newCurrentValue)
          set the current value of the capacity
 void setDelegate(CapacityMonitor cm)
          Set the delegated one
 void setName(java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

java.lang.String name

monitor

CapacityMonitor monitor

listeners

CopyOnWriteArrayList listeners
Constructor Detail

DelegateCapacityMonitor

public DelegateCapacityMonitor()
Construct a DelegateCapacityMonitor


DelegateCapacityMonitor

public DelegateCapacityMonitor(java.lang.String name,
                               CapacityMonitor cm)
Construct a DelegateCapacityMonitor

Method Detail

setDelegate

public void setDelegate(CapacityMonitor cm)
Set the delegated one


getName

public java.lang.String getName()
Get the name of the CapacityMonitor

Specified by:
getName in interface CapacityMonitor

setName

public void setName(java.lang.String newName)
Description copied from interface: CapacityMonitor
Set the name of the CapacityMonitor

Specified by:
setName in interface CapacityMonitor

getRoundingFactor

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

Specified by:
getRoundingFactor in interface CapacityMonitor

setRoundingFactor

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

Specified by:
setRoundingFactor in interface CapacityMonitor

addCapacityEventListener

public void addCapacityEventListener(CapacityMonitorEventListener l)
Add a CapacityEventListener

Specified by:
addCapacityEventListener in interface CapacityMonitor

removeCapacityEventListener

public void removeCapacityEventListener(CapacityMonitorEventListener l)
Remove a CapacityEventListener

Specified by:
removeCapacityEventListener in interface CapacityMonitor

getCurrentCapacity

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

Specified by:
getCurrentCapacity in interface CapacityMonitor

getRoundedCapacity

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

Specified by:
getRoundedCapacity in interface CapacityMonitor

getCurrentValue

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

Specified by:
getCurrentValue in interface CapacityMonitor

setCurrentValue

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

Specified by:
setCurrentValue in interface CapacityMonitor

getValueLimit

public long getValueLimit()
Specified by:
getValueLimit in interface CapacityMonitor

setValueLimit

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

Specified by:
setValueLimit in interface CapacityMonitor

generateCapacityMonitorEvent

public CapacityMonitorEvent generateCapacityMonitorEvent()
Specified by:
generateCapacityMonitorEvent in interface CapacityMonitor