org.apache.excalibur.instrument
Interface InstrumentProxy

All Known Implementing Classes:
InstrumentProxy

public interface InstrumentProxy

Because some components using Instruments will be created in large numbers a way is needed to collect data from the instances of all instances of a component class without maintaining references to Instruments of each instance. An Instrument Manager can do this by making use of Instrument Proxies. Each Instrument is assigned a proxy when it is registered with the manager, then all communication is made through the proxy The Instrument interface must by implemented by any object wishing to act as an instrument used by the instrument manager.

Since:
4.1
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:28 $
Author:
Avalon Development Team

Method Summary
 void increment(int count)
          Increments the Instrument by a specified count.
 boolean isActive()
          Used by classes being profiles so that they can avoid unnecessary code when the data from a Instrument is not being used.
 void setValue(int value)
          Sets the current value of the Instrument.
 

Method Detail

isActive

public boolean isActive()
Used by classes being profiles so that they can avoid unnecessary code when the data from a Instrument is not being used.

Returns:
True if listeners are registered with the Instrument.

increment

public void increment(int count)
Increments the Instrument by a specified count. This method should be optimized to be extremely light weight when there are no registered CounterInstrumentListeners.

This method may throw an IllegalStateException if the proxy is not meant to handle calls to increment.

Parameters:
count - A positive integer to increment the counter by.

setValue

public void setValue(int value)
Sets the current value of the Instrument. This method is optimized to be extremely light weight when there are no registered ValueInstrumentListeners.

This method may throw an IllegalStateException if the proxy is not meant to handle calls to setValue.

Parameters:
value - The new value for the Instrument.


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.