|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
interface InstrumentSample
InstrumentSamples are used to provide an Instrument with state. Samples have a sample interval, which is the period over which data is grouped.
InstrmentSamples can be created when the InstrumentManager is created as part of the configuration process, or as a result of a request from an InstrumentClient.
Method Summary | |
---|---|
void |
addInstrumentSampleListener(org.apache.excalibur.instrument.manager.InstrumentSampleListener listener)
Registers a InstrumentSampleListener with a InstrumentSample given a name. |
void |
expire()
Tells the sample that its lease has expired. |
long |
extendLease(long lease)
Extends the lease to be lease milliseconds from the current time. |
java.lang.String |
getDescription()
Returns the description of the sample. |
org.apache.excalibur.instrument.manager.InstrumentSampleDescriptor |
getDescriptor()
Returns a Descriptor for the InstrumentSample. |
InstrumentProxy |
getInstrumentProxy()
Returns the InstrumentProxy which owns the InstrumentSample. |
int |
getInstrumentType()
Returns the Type of the Instrument which can use the sample. |
long |
getInterval()
Returns the sample interval. |
long |
getLeaseExpirationTime()
Returns the time that the current lease expires. |
java.lang.String |
getName()
Returns the name of the sample. |
int |
getSize()
Returns the number of samples in the sample history. |
org.apache.excalibur.instrument.manager.InstrumentSampleSnapshot |
getSnapshot()
Obtains a static snapshot of the InstrumentSample. |
int |
getStateVersion()
Returns the stateVersion of the sample. |
long |
getTime()
Obtain the UNIX time of the beginning of the sample. |
int |
getType()
Returns the type of the Instrument Sample. |
int |
getValue()
Obtain the value of the sample. |
boolean |
isConfigured()
Returns true if the InstrumentSample was configured in the instrumentables section of the configuration. |
void |
loadState(org.apache.avalon.framework.configuration.Configuration state)
Loads the state into the InstrumentSample. |
void |
removeInstrumentSampleListener(org.apache.excalibur.instrument.manager.InstrumentSampleListener listener)
Unregisters a InstrumentSampleListener from a InstrumentSample given a name. |
void |
writeState(java.io.PrintWriter out)
Writes the current state to a PrintWriter as XML. |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
---|
enableLogging |
Method Detail |
---|
InstrumentProxy getInstrumentProxy()
boolean isConfigured()
java.lang.String getName()
long getInterval()
int getSize()
java.lang.String getDescription()
int getType()
org.apache.excalibur.instrument.manager.InstrumentSampleDescriptor getDescriptor()
int getValue()
long getTime()
int getInstrumentType()
Should be one of the following: DefaultInstrumentManager.INSTRUMENT_TYPE_COUNTER or DefaultInstrumentManager.INSTRUMENT_TYPE_VALUE
long getLeaseExpirationTime()
long extendLease(long lease)
lease
- The length of the lease in milliseconds.
void expire()
org.apache.excalibur.instrument.manager.InstrumentSampleSnapshot getSnapshot()
int getStateVersion()
void addInstrumentSampleListener(org.apache.excalibur.instrument.manager.InstrumentSampleListener listener)
listener
- The listener which should start receiving updates from the
InstrumentSample.void removeInstrumentSampleListener(org.apache.excalibur.instrument.manager.InstrumentSampleListener listener)
listener
- The listener which should stop receiving updates from the
InstrumentSample.void writeState(java.io.PrintWriter out)
out
- The PrintWriter to which the state should be written.void loadState(org.apache.avalon.framework.configuration.Configuration state) throws org.apache.avalon.framework.configuration.ConfigurationException
state
- Configuration object to load state from.
org.apache.avalon.framework.configuration.ConfigurationException
- If there were any problems loading the
state.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |