|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.ce.monitorapij.types.CEMonResourceBase
org.glite.ce.monitorapij.types.CEMonResource
org.glite.ce.monitorapij.sensor.AbstractSensor
Base abstract class which must be extended by all sensor plugins.
It extends CEMonResource
and implements interfaces Runnable
, Resource
,
Sensor
and MonitorListener
.
It provides methods to control the sensor execution and to manage the SensorListener
s and supported formats.
Field Summary |
Fields inherited from class org.glite.ce.monitorapij.types.CEMonResource |
creationTime, newResource |
Constructor Summary | |
AbstractSensor()
Create a new AbstractSensor object named "CE Sensor" and of type "Sensor". |
|
AbstractSensor(java.lang.String name,
java.lang.String type)
Create a new AbstractSensor object. |
Method Summary | |
void |
addFormat(SensorOutputDataFormat format)
Add a format to the ArrayList of supported formats. |
void |
addSensorListener(SensorListener l)
Add a SensorListener to the sensor. |
void |
destroySensor()
Not yet implemented. |
void |
doOnMonitorEvent(MonitorEvent mEvt)
Specify the things to do when a MonitorEvent occurs. |
protected void |
fireSensorEvent(SensorEvent event)
Notify all listeners that have registered interest for notification on this event type. |
SensorOutputDataFormat |
getDefaultFormat()
Get the default format if previously set or the first saved supported format. |
SensorOutputDataFormat |
getFormat(java.lang.String format)
Get the SensorOutputDataFormat named as specified if it is supported. |
SensorOutputDataFormat[] |
getFormats()
Get all the supported formats. |
SensorListener[] |
getSensorListeners()
Get an array of all the SensorListener s added to this
AbstractSensor with addSensorListener(). |
void |
init()
Initialize the Sensor. |
boolean |
isFormatSupported(SensorOutputDataFormat sensorOutputDataFormat)
Check if the specified SensorOutputDataFormat is supported. |
boolean |
isFormatSupported(java.lang.String format)
Check if the SensorOutputDataFormat named as specified is supported. |
void |
removeFormat(SensorOutputDataFormat format)
Remove the specified format. |
void |
removeSensorListener(SensorListener l)
Remove a SensorListener from the sensor. |
void |
resumeSensor()
Resumes the execution of the Sensor. |
void |
run()
Launch the execute() method of Sensor thread each executionDelay time interval. |
void |
setDefaultFormat(SensorOutputDataFormat format)
Set the default format. |
void |
startSensor()
Start the execution of the Sensor intended as a Thread if the Property executionDelay has been defined. |
void |
suspendSensor()
Suspend the execution of the Sensor. |
Methods inherited from class org.glite.ce.monitorapij.types.CEMonResource |
exists, getCreationTime, getProperty, isNew, lastModified, removeHiddenProperties, setCreationTime, setId, setNew |
Methods inherited from class org.glite.ce.monitorapij.types.CEMonResourceBase |
equals, getDeserializer, getId, getJarPath, getName, getProperty, getProperty, getSerializer, getType, getTypeDesc, hashCode, setId, setJarPath, setName, setProperty, setProperty, setType |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.glite.ce.monitorapij.resource.Resource |
exists, getCreationTime, getId, getJarPath, getName, getProperty, getProperty, getProperty, getType, isNew, lastModified, setCreationTime, setId, setId, setJarPath, setName, setNew, setProperty, setProperty, setType |
Methods inherited from interface org.glite.ce.monitorapij.sensor.Sensor |
execute, getName, getType |
Constructor Detail |
public AbstractSensor()
public AbstractSensor(java.lang.String name, java.lang.String type)
AbstractSensor
object.
name
- The name of AbstractSensor
type
- The type of AbstractSensor
Method Detail |
public SensorOutputDataFormat getFormat(java.lang.String format)
getFormat
in interface Sensor
format
- The name of the searched format.
SensorOutputDataFormat
if this is supported, null otherwise.Sensor.getFormat(java.lang.String)
public SensorOutputDataFormat[] getFormats()
getFormats
in interface Sensor
Sensor.getFormats()
public void setDefaultFormat(SensorOutputDataFormat format)
setDefaultFormat
in interface Sensor
format
- The SensorOutputDataFormat to be set as default.
This must be not null and supported.Sensor.setDefaultFormat(org.glite.ce.monitorapij.sensor.SensorOutputDataFormat)
public SensorOutputDataFormat getDefaultFormat()
getDefaultFormat
in interface Sensor
public void addFormat(SensorOutputDataFormat format)
addFormat
in interface Sensor
format
- The SensorOutputDataFormat
to addpublic void removeFormat(SensorOutputDataFormat format)
removeFormat
in interface Sensor
format
- the SensorOutputDataFormat
to be removedSensor.removeFormat(org.glite.ce.monitorapij.sensor.SensorOutputDataFormat)
public boolean isFormatSupported(SensorOutputDataFormat sensorOutputDataFormat)
SensorOutputDataFormat
is supported.
isFormatSupported
in interface Sensor
sensorOutputDataFormat
- The SensorOutputDataFormat
to check.
isFormatSupported(java.lang.String)
,
Sensor.isFormatSupported(org.glite.ce.monitorapij.sensor.SensorOutputDataFormat)
public boolean isFormatSupported(java.lang.String format)
SensorOutputDataFormat
named as specified is supported.
isFormatSupported
in interface Sensor
format
- The name of the SensorOutputDataFormat
to be checked.
Sensor.isFormatSupported(java.lang.String)
public SensorListener[] getSensorListeners()
SensorListener
s added to this
AbstractSensor with addSensorListener().
getSensorListeners
in interface Sensor
SensorListener
s added or an empty array
if no listeners have been added.public void addSensorListener(SensorListener l)
SensorListener
to the sensor.
addSensorListener
in interface Sensor
l
- The SensorListener
to be added.public void removeSensorListener(SensorListener l)
SensorListener
from the sensor.
removeSensorListener
in interface Sensor
l
- The listener to be removed.protected void fireSensorEvent(SensorEvent event)
event
parameter.
event
- The SensorEvent
object.public void init() throws SensorException
init
in interface Sensor
SensorException
- thrown if something gone wrong during initialization.public void startSensor()
Property
executionDelay has been defined.
Otherwise log a warning "executionDelay property not found!".
startSensor
in interface Sensor
Sensor.startSensor()
public void suspendSensor()
suspendSensor
in interface Sensor
Sensor.suspendSensor()
public void resumeSensor()
resumeSensor
in interface Sensor
Sensor.resumeSensor()
public void destroySensor()
destroySensor
in interface Sensor
Sensor.destroySensor()
public void run()
run
in interface java.lang.Runnable
Runnable.run()
public void doOnMonitorEvent(MonitorEvent mEvt)
MonitorEvent
occurs.
doOnMonitorEvent
in interface MonitorListener
mEvt
- The MonitorEvent events the listener is interested in.MonitorListener.doOnMonitorEvent(org.glite.ce.monitorapij.sensor.MonitorEvent)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |