mx4j.tools.stats
Class ValueStatisticsRecorder

java.lang.Object
  extended bymx4j.tools.stats.AbstractStatisticsRecorder
      extended bymx4j.tools.stats.ValueStatisticsRecorder
All Implemented Interfaces:
javax.management.MBeanRegistration, StatisticsRecorderMBean, ValueStatisticsRecorderMBean

public class ValueStatisticsRecorder
extends AbstractStatisticsRecorder
implements ValueStatisticsRecorderMBean

ValueStatisticsRecorder records statistics of an attribute based on changes on the variable value. If you want to use you have to explictly set the variable value.

Example usage:

 ObjectName name = new ObjectName("Domain:name=value");
 server.createMBean("mx4j.tools.stats.ValueStatisticsRecorder", name, null);
 server.invoke(name, "start", null, null);
 // Every time the value is set the statistics are updated
 server.setAttribute(name, "Attribute", new Double(10));
 

Version:
$Revision: 1.5 $

Field Summary
protected  java.lang.Number value
           
 
Fields inherited from class mx4j.tools.stats.AbstractStatisticsRecorder
averageValue, count, entries, isActive, isDouble, maxEntries, maximumValue, minimumValue, recordingStart, server
 
Constructor Summary
ValueStatisticsRecorder()
           
 
Method Summary
 java.lang.Number getValue()
          Returns the recorded value
 void setValue(java.lang.Number value)
          Sets the value to be recorded
 java.lang.String toString()
           
 
Methods inherited from class mx4j.tools.stats.AbstractStatisticsRecorder
addEntry, doStart, doStop, getAverage, getEntries, getLogger, getMax, getMaxEntries, getMin, getRecordingStart, isActive, postDeregister, postRegister, preDeregister, preRegister, setMaxEntries, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mx4j.tools.stats.StatisticsRecorderMBean
getAverage, getEntries, getMax, getMaxEntries, getMin, getRecordingStart, isActive, setMaxEntries, start, stop
 

Field Detail

value

protected java.lang.Number value
Constructor Detail

ValueStatisticsRecorder

public ValueStatisticsRecorder()
Method Detail

setValue

public void setValue(java.lang.Number value)
Description copied from interface: ValueStatisticsRecorderMBean
Sets the value to be recorded

Specified by:
setValue in interface ValueStatisticsRecorderMBean

getValue

public java.lang.Number getValue()
Description copied from interface: ValueStatisticsRecorderMBean
Returns the recorded value

Specified by:
getValue in interface ValueStatisticsRecorderMBean

toString

public java.lang.String toString()


Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.