public class LoadSensorManager
The LoadSensorManager implements the load sensor protocol. A load
sensor can use this class either by instantiating an instance and passing
in the LoadSensor implementation instance or by running the
LoadSensorManager class directly and passing as an argument the
name of the class to be run as the LoadSensor implementation.
Once started, the LoadSensorManager instance reads the input from the
load sensor framework from stdin and writes commands to stdout. The
load sensor protocol is completely encapsulated, however, allowing the
LoadSensor implementation to work at the level of name=value pairs for
measured load values.
The LoadSensorManager will monitor how often it is asked for load values
and how long it takes to take a measurement. It will use that information
to try to optimally schedule the next measurement. The idea is to run
the measurement as late as possible but still have it complete before
the next time load values are requested.
Alternatively, the load sensor may specify its own measurement interval
independent of when the load value requests are made. In that case,
the measurements are made in a separate thread, and load value requests
are given the last set of load values reported by the measurement
The LoadSensorManager class uses the Logger named
"com.sun.grid.LoadSensor". By default, the Logger has no handlers
installed. In order to enable logging, add a handler, i.e. a FileHandler
It is always a good idea to enabling logging, as errors in load sensor
protocol handling will be logged as warnings, but will not be visible any
Start the load sensor. This method reads commands from the
execution daemon and triggers appropriate actions on the managed
load sensor. This method will not return until the input stream is
closed or it reads "QUIT\n" from the stream.
java.io.IOException - Thrown is there is an error communicating
with the execution daemon