org.apache.excalibur.instrument.manager.impl
Class MaximumValueInstrumentSample

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample
          extended by org.apache.excalibur.instrument.manager.impl.AbstractValueInstrumentSample
              extended by org.apache.excalibur.instrument.manager.impl.MaximumValueInstrumentSample
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled, InstrumentSample, org.apache.excalibur.instrument.manager.InstrumentListener, org.apache.excalibur.instrument.manager.ValueInstrumentListener

 class MaximumValueInstrumentSample
extends AbstractValueInstrumentSample

A InstrumentSample which stores the maximum value set during the sample period.

Author:
Avalon Development Team

Field Summary
 
Fields inherited from class org.apache.excalibur.instrument.manager.impl.AbstractValueInstrumentSample
m_lastValue, m_value, m_valueCount
 
Fields inherited from class org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample
m_time
 
Constructor Summary
MaximumValueInstrumentSample(InstrumentProxy instrumentProxy, java.lang.String name, long interval, int size, java.lang.String description, long lease)
          Creates a new MaximumValueInstrumentSample
 
Method Summary
 int getType()
          Returns the type of the Instrument Sample.
protected  void setValueInner(int value, long time)
          Sets the current value of the sample.
 
Methods inherited from class org.apache.excalibur.instrument.manager.impl.AbstractValueInstrumentSample
advanceToNextSample, getFillValue, getInstrumentType, getValueInner, loadState, setValue, writeStateAttributes
 
Methods inherited from class org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample
addInstrumentSampleListener, expire, extendLease, getDescription, getDescriptor, getInstrumentProxy, getInterval, getLeaseExpirationTime, getName, getSize, getSnapshot, getStateVersion, getTime, getValue, isConfigured, loadState, makePermanent, removeInstrumentSampleListener, setConfigured, stateChanged, toString, update, updateListeners, writeState
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled
enableLogging
 

Constructor Detail

MaximumValueInstrumentSample

MaximumValueInstrumentSample(InstrumentProxy instrumentProxy,
                             java.lang.String name,
                             long interval,
                             int size,
                             java.lang.String description,
                             long lease)
Creates a new MaximumValueInstrumentSample

Parameters:
instrumentProxy - The InstrumentProxy which owns the InstrumentSample.
name - The name of the new InstrumentSample.
interval - The sample interval of the new InstrumentSample.
size - The number of samples to store as history. Assumes that size is at least 1.
description - The description of the new InstrumentSample.
lease - The length of the lease in milliseconds.
Method Detail

getType

public int getType()
Returns the type of the Instrument Sample.

Returns:
The type of the Instrument Sample.

setValueInner

protected void setValueInner(int value,
                             long time)
Sets the current value of the sample. The value will be set as the sample value if it is the largest value seen during the sample period.

Specified by:
setValueInner in class AbstractValueInstrumentSample
Parameters:
value - New sample value.
time - Time that the new sample arrives.