|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample
org.apache.excalibur.instrument.manager.impl.AbstractValueInstrumentSample
abstract class AbstractValueInstrumentSample
An AbstractValueInstrumentSample contains all of the functionality common to all InstrumentSamples which represent a fixed value.
Field Summary | |
---|---|
protected int |
m_lastValue
Last value set to the sample for use for sample periods where no value is set. |
protected int |
m_value
The sample value. |
protected int |
m_valueCount
The number of times that the value has been changed in this sample period. |
Fields inherited from class org.apache.excalibur.instrument.manager.impl.AbstractInstrumentSample |
---|
m_time |
Constructor Summary | |
---|---|
protected |
AbstractValueInstrumentSample(InstrumentProxy instrumentProxy,
java.lang.String name,
long interval,
int size,
java.lang.String description,
long lease)
Creates a new AbstractValueInstrumentSample |
Method Summary | |
---|---|
protected void |
advanceToNextSample(boolean reset)
The current sample has already been stored. |
protected int |
getFillValue()
Returns the value to use for filling in the buffer when time is skipped. |
int |
getInstrumentType()
Returns the Type of the Instrument which can use the sample. |
int |
getValueInner()
Obtain the value of the sample. |
protected void |
loadState(int value,
org.apache.avalon.framework.configuration.Configuration state)
Used to load the state, called from AbstractInstrumentSample.loadState(); |
void |
setValue(java.lang.String instrumentName,
int value,
long time)
Called by a ValueInstrument whenever its value is set. |
protected abstract void |
setValueInner(int value,
long time)
Sets the current value of the sample. |
protected void |
writeStateAttributes(java.io.PrintWriter out)
Allow subclasses to add information into the saved state. |
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.excalibur.instrument.manager.impl.InstrumentSample |
---|
getType |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
---|
enableLogging |
Field Detail |
---|
protected int m_value
protected int m_valueCount
protected int m_lastValue
Constructor Detail |
---|
protected AbstractValueInstrumentSample(InstrumentProxy instrumentProxy, java.lang.String name, long interval, int size, java.lang.String description, long lease)
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 |
---|
public final int getInstrumentType()
This InstrumentSample returns DefaultInstrumentManager.INSTRUMENT_TYPE_VALUE
getInstrumentType
in interface InstrumentSample
public int getValueInner()
Should only be called when synchronized.
getValueInner
in class AbstractInstrumentSample
protected void advanceToNextSample(boolean reset)
Should only be called when synchronized.
advanceToNextSample
in class AbstractInstrumentSample
reset
- True if the next sample should be reset.protected int getFillValue()
Should only be called when synchronized.
getFillValue
in class AbstractInstrumentSample
protected void writeStateAttributes(java.io.PrintWriter out)
writeStateAttributes
in class AbstractInstrumentSample
out
- PrintWriter to write to.protected void loadState(int value, org.apache.avalon.framework.configuration.Configuration state) throws org.apache.avalon.framework.configuration.ConfigurationException
Should only be called when synchronized.
loadState
in class AbstractInstrumentSample
value
- Current value loaded from the state.state
- Configuration object to load state from.
org.apache.avalon.framework.configuration.ConfigurationException
- If there were any problems loading the
state.public void setValue(java.lang.String instrumentName, int value, long time)
setValue
in interface org.apache.excalibur.instrument.manager.ValueInstrumentListener
instrumentName
- The key of Instrument whose value was set.value
- Value that was set.time
- The time that the Instrument was incremented.
ValueInstrumentprotected abstract void setValueInner(int value, long time)
value
- New sample value.time
- Time that the new sample arrives.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |