org.gridlab.gat.monitoring
Interface Monitorable

All Known Subinterfaces:
AdvertService, CoScheduleJob, Endpoint, HardwareResource, Job, LogicalFile, Pipe, Resource, WrapperJob
All Known Implementing Classes:
File, FileInputStream, FileOutputStream, SoftwareResource

public interface Monitorable

Interface which is to be implemented by any classes which are capable of being monitored.


Method Summary
 void addMetricListener(MetricListener metricListener, Metric metric)
          This method adds the passed instance of a MetricListener to the list of MetricListeners which are notified of MetricEvents by an instance of this class.
 MetricEvent getMeasurement(Metric metric)
          Returns a MetricEvent that represents the measured Metric.
 MetricDefinition getMetricDefinitionByName(String name)
          Gets the MetricDefinition using its name.
 List<MetricDefinition> getMetricDefinitions()
          This method returns a List of MetricDefinition instances.
 void removeMetricListener(MetricListener metricListener, Metric metric)
          Removes the passed MetricListener from the List of MetricListeners which are notified of MetricEvents corresponding to the passed Metric instance.
 

Method Detail

addMetricListener

void addMetricListener(MetricListener metricListener,
                       Metric metric)
                       throws GATInvocationException
This method adds the passed instance of a MetricListener to the list of MetricListeners which are notified of MetricEvents by an instance of this class. The passed MetricListener is only notified of MetricEvents which correspond to Metric instance passed to this method.

Parameters:
metricListener - The MetricListener to notify of MetricEvents
metric - The Metric corresponding to the MetricEvents for which the passed MetricListener will be notified
Throws:
GATInvocationException - The MetricListener cannot be added

removeMetricListener

void removeMetricListener(MetricListener metricListener,
                          Metric metric)
                          throws GATInvocationException
Removes the passed MetricListener from the List of MetricListeners which are notified of MetricEvents corresponding to the passed Metric instance.

Parameters:
metricListener - The MetricListener to notify of MetricEvents
metric - The Metric corresponding to the MetricEvents for which the passed MetricListener has been notified
Throws:
GATInvocationException - The MetricListener cannot be removed

getMetricDefinitions

List<MetricDefinition> getMetricDefinitions()
                                            throws GATInvocationException
This method returns a List of MetricDefinition instances. Each instance in this List is a MetricDefinition which can be monitored on this instance.

Returns:
An List of MetricDefinition instances. Each instance in this List is a Metric which can be monitored on this instance
Throws:
GATInvocationException - An error occurred while getting the list of metrics

getMetricDefinitionByName

MetricDefinition getMetricDefinitionByName(String name)
                                           throws GATInvocationException
Gets the MetricDefinition using its name.

Parameters:
name - The MetricDefinition name
Returns:
The MetricDefinition with the given name
Throws:
GATInvocationException - An error occurred while getting the list of Metrics or no Metric with this name exists

getMeasurement

MetricEvent getMeasurement(Metric metric)
                           throws GATInvocationException
Returns a MetricEvent that represents the measured Metric.

Returns:
a MetricEvent that represents the measured Metric.
Throws:
GATInvocationException - the measurement failed