org.isam.exehda.services
Interface Collector.Monitor

All Known Implementing Classes:
Collector.AppMonitor, NativeMonitor, TipsMonitor
Enclosing interface:
Collector

public static interface Collector.Monitor

Represents a component that exports/manages a group of sensors.


Method Summary
 CellInformationBase.ResourceName getName()
          Returns the name of the monitor.
 Collector.Sensor getSensor(java.lang.String name)
          Returns the sensor described by name, if it does exist.
 java.lang.Object getSensorParameter(Collector.SensorParameter p)
          Queries the current value of a sensor parameter.
 Collector.SensorParameter[] getSensorParameters(Collector.Sensor s)
          Returns the set of parameters supported by the given sensor.
 Collector.Sensor[] getSensors()
          Returns an array containing the sensors this monitor currently provides.
 void installSensor(java.lang.String name, java.lang.String impl, java.util.Hashtable params)
          Asks for a sensor to be installed.
 boolean isSensorEnabled(Collector.Sensor s)
          Returns the current enabling status of a sensor (i.e. enabled or disabled)
 Collector.MonitoringData probeSensor(Collector.Sensor s, Collector.MonitoringData d)
          Queries the current value of a sensor (i.e. the monitoring data extracted by the sensor).
 void quantumExpired()
          Notifies the monitor that a monitoring quantum has expired, so sensors' current values must be updated.
 void setSensorEnabled(Collector.Sensor s, boolean enable)
          Enables/disables a sensor.
 void setSensorParameter(Collector.SensorParameter p, java.lang.Object v)
          Sets the value of a sensor parameter.
 

Method Detail

getName

public CellInformationBase.ResourceName getName()
Returns the name of the monitor. The monitor's name defines the namespace for sensors exported by the monitor. Its also used to control which kind of sensors the monitor whould be able to install on-demand.

Returns:
the monitor's name

getSensors

public Collector.Sensor[] getSensors()
Returns an array containing the sensors this monitor currently provides. The set of supported sensors may grow due to new sensor install requests.

Returns:
currently available sensors

getSensor

public Collector.Sensor getSensor(java.lang.String name)
Returns the sensor described by name, if it does exist.

Parameters:
name - sensor name
Returns:
a Sensor object or null if there is no such sensor

getSensorParameters

public Collector.SensorParameter[] getSensorParameters(Collector.Sensor s)
Returns the set of parameters supported by the given sensor.

Parameters:
s - a valid sensor object
Returns:
an array of SensorParameter objects describing the supported parameters.

getSensorParameter

public java.lang.Object getSensorParameter(Collector.SensorParameter p)
Queries the current value of a sensor parameter.

Parameters:
p - a SensorParameter object
Returns:
the current parameter value or null if there is no such parameter

setSensorParameter

public void setSensorParameter(Collector.SensorParameter p,
                               java.lang.Object v)
Sets the value of a sensor parameter.

Parameters:
p - a SensorParameter object
v - the new parameter value

setSensorEnabled

public void setSensorEnabled(Collector.Sensor s,
                             boolean enable)
Enables/disables a sensor. Only enabled sensors produce monitoring data.

Parameters:
s - a Sensor value
enable - a boolean value

isSensorEnabled

public boolean isSensorEnabled(Collector.Sensor s)
Returns the current enabling status of a sensor (i.e. enabled or disabled)

Parameters:
s - a Sensor object
Returns:
true if the sensor is enabled, false otherwise.

probeSensor

public Collector.MonitoringData probeSensor(Collector.Sensor s,
                                            Collector.MonitoringData d)
Queries the current value of a sensor (i.e. the monitoring data extracted by the sensor). In order to minimize memory consumption, if a Monitoring data is provided, that object is updated with the current sensor value and returned. If null is provided, a new MonitoringData is allocated for hold the sensor value.

Parameters:
s - a Sensor object
d - a MonitoringData object or null
Returns:
a MonitoringData object describind the current sensor value

installSensor

public void installSensor(java.lang.String name,
                          java.lang.String impl,
                          java.util.Hashtable params)
Asks for a sensor to be installed. This operation would fail if the underlaying monitor does not support on-demand installation of sensors.

Parameters:
name - a String value
impl - a String value
params - a Hashtable value

quantumExpired

public void quantumExpired()
Notifies the monitor that a monitoring quantum has expired, so sensors' current values must be updated.