|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface Monitor is a facade (design pattern) for accessing underlying monitoring sensors. The main concerns which lead us to follow this organization were: - The monitor would, eventually, be accessed from a remote node; whereas - raw sensor implementations should not ever be individually accessed. The adoption of the facade design pattern allows the monitor to enforce sensor configuration policies which are consistent for all the monitoring consumers. In order to reduce memory consumption, the flyweight design pattern is used for managing Sensor and SensorParameter objects.
Nested Class Summary | |
static class |
Monitor.Sensor
Describes a sensor supported by this monitor. |
static class |
Monitor.SensorParameter
Describes a sensor parameter. |
Method Summary | |
java.lang.Object |
getSensorParameter(Monitor.SensorParameter p)
Returns the current value of the given sensor parameter. |
Monitor.SensorParameter[] |
getSensorParameters(Monitor.Sensor s)
Lists the parameters supported by the given sensor. |
Monitor.Sensor[] |
getSensors()
Lists sensors made available by this monitor. |
boolean |
isSensorEnabled(Monitor.Sensor s)
Returns the enable state of the given sensor. |
java.lang.Object |
probeSensor(Monitor.Sensor s)
Gets the current value of the given sensor. |
void |
setSensorEnabled(Monitor.Sensor s,
boolean enable)
Enable/disables the given sensor. |
void |
setSensorParameter(Monitor.SensorParameter p,
java.lang.Object v)
Configures the given sensor parameter to have the value v .
|
Method Detail |
public Monitor.Sensor[] getSensors()
public void setSensorEnabled(Monitor.Sensor s, boolean enable)
s
- a Sensorenable
- true for enabling the sensor, false otherwise.public boolean isSensorEnabled(Monitor.Sensor s)
s
- a sensor
public void setSensorParameter(Monitor.SensorParameter p, java.lang.Object v)
v
.
This operation may be vetoed by the monitor if the sensor is already
configured to operate in a finner grain mode. In that case, the
effect of calling this method is void. No error condition is signed.
p
- a SensorParameter
valuev
- new value to be assigned to the parameterpublic java.lang.Object getSensorParameter(Monitor.SensorParameter p)
p
- a sensor parameter
public Monitor.SensorParameter[] getSensorParameters(Monitor.Sensor s)
s
- a sensor
public java.lang.Object probeSensor(Monitor.Sensor s)
getType()
method of the given sensor.
s
- an enabled sensor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |