org.globus.mds.usefulrp
Class AccumulatorResourceProperty

java.lang.Object
  extended byorg.globus.wsrf.impl.BaseResourceProperty
      extended byorg.globus.wsrf.impl.ReflectionResourceProperty
          extended byorg.globus.mds.usefulrp.AccumulatorResourceProperty
All Implemented Interfaces:
ResourceProperty

public class AccumulatorResourceProperty
extends ReflectionResourceProperty

An MDS ResourceProperty that will allow services to easily publish metrics about their load.
This RP is specfically designed for measuring cumulative quantities (such as number of hits, number of bytes transferred), with the TODO ability to publish derived statistics such as average rate of change of the accumulator (which will provide, for example, hits/second or bytes/second).
Note that this RP implements no persistence (in order to have minimal dependencies on other configuration) but will TODO indicate in its output when it began making the present set of measurements.


Field Summary
(package private)  java.util.Date lastCalculation
          keeps track of when we last performed decays.
private static org.apache.commons.logging.Log logger
           
(package private)  Accumulator publishedValue
          The stub type that will be serialised to go over the wire.
 
Fields inherited from class org.globus.wsrf.impl.ReflectionResourceProperty
 
Fields inherited from class org.globus.wsrf.impl.BaseResourceProperty
metaData
 
Constructor Summary
AccumulatorResourceProperty(javax.xml.namespace.QName name)
           
 
Method Summary
 void accumulate(long amount)
           
 java.lang.Object getDynamicValue()
           
(package private)  void performDecays(double q)
           
 
Methods inherited from class org.globus.wsrf.impl.ReflectionResourceProperty
add, clear, get, getValueSimple, initialize, isArray, isEmpty, iterator, remove, set, setObject, setPropertyName, size, toElements, toSOAPElements
 
Methods inherited from class org.globus.wsrf.impl.BaseResourceProperty
convert, convertObject, convertPrimitive, getMetaData, setMetaData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.apache.commons.logging.Log logger

publishedValue

Accumulator publishedValue
The stub type that will be serialised to go over the wire.


lastCalculation

java.util.Date lastCalculation
keeps track of when we last performed decays. This is different from the output schema lastChange value.

Constructor Detail

AccumulatorResourceProperty

public AccumulatorResourceProperty(javax.xml.namespace.QName name)
                            throws java.lang.Exception
Throws:
java.lang.Exception - passes along any exception encountered during construction of underlying ReflectionResourceProperty.
Method Detail

getDynamicValue

public java.lang.Object getDynamicValue()

accumulate

public void accumulate(long amount)

performDecays

void performDecays(double q)