eu.reservoir.monitoring.core
Class AbstractDataConsumer

java.lang.Object
  extended by eu.reservoir.monitoring.core.AbstractPlaneInteracter
      extended by eu.reservoir.monitoring.core.AbstractDataConsumer
All Implemented Interfaces:
MeasurementReceiver, PlaneInteracter, java.lang.Runnable
Direct Known Subclasses:
BasicConsumer

public abstract class AbstractDataConsumer
extends AbstractPlaneInteracter
implements MeasurementReceiver, java.lang.Runnable

An AbstractDataConsumer interacts with the data plane, control plane, and the info plane and collects measurements. The measurements are passed on to all the Reporters added to the Consumer.


Constructor Summary
AbstractDataConsumer()
          Construct an AbstractDataConsumer.
 
Method Summary
 void addReporter(Reporter l)
          Add a Reporter.
 void beginThreadBody()
          The code to run at the begining of the thread body.
 void clearReporters()
          Clear away all the Reporters.
 void endThreadBody()
          The code to run at the end of the thread body.
 int getReporterCount()
          Count the Reporters.
 java.lang.Object[] getReporters()
          List all Reporters.
 void removeReporter(Reporter l)
          Remove a Reporter.
 Measurement report(Measurement m)
          Receiver of a measurement, with the measurement.
 void run()
          The thread body.
 PlaneInteracter setControlPlane(ControlPlane controlPlane)
          Set the ControlPlane this is a delegate for.
 PlaneInteracter setDataPlane(DataPlane dataPlane)
          Set the DataPlane this is a delegate for.
 PlaneInteracter setInfoPlane(InfoPlane infoPlane)
          Set the InfoPlane this is a delegate for.
 Reporter setReporter(Reporter reporter)
          Set the Reporter object.
protected  void startQueueHandlingThread()
          Activate the forwarding from the queue to the Reporters by starting the thread.
protected  void stopQueueHandlingThread()
          Deactivate the forwarding from the queue to the Reporters by stopping the thread.
 
Methods inherited from class eu.reservoir.monitoring.core.AbstractPlaneInteracter
announce, connect, dennounce, disconnect, getControlPlane, getDataPlane, getInfoPlane, isConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataConsumer

public AbstractDataConsumer()
Construct an AbstractDataConsumer.

Method Detail

startQueueHandlingThread

protected void startQueueHandlingThread()
Activate the forwarding from the queue to the Reporters by starting the thread.


stopQueueHandlingThread

protected void stopQueueHandlingThread()
Deactivate the forwarding from the queue to the Reporters by stopping the thread.


setDataPlane

public PlaneInteracter setDataPlane(DataPlane dataPlane)
Set the DataPlane this is a delegate for.

Specified by:
setDataPlane in interface PlaneInteracter
Overrides:
setDataPlane in class AbstractPlaneInteracter

setControlPlane

public PlaneInteracter setControlPlane(ControlPlane controlPlane)
Set the ControlPlane this is a delegate for.

Specified by:
setControlPlane in interface PlaneInteracter
Overrides:
setControlPlane in class AbstractPlaneInteracter

setInfoPlane

public PlaneInteracter setInfoPlane(InfoPlane infoPlane)
Set the InfoPlane this is a delegate for.

Specified by:
setInfoPlane in interface PlaneInteracter
Overrides:
setInfoPlane in class AbstractPlaneInteracter

setReporter

public Reporter setReporter(Reporter reporter)
Set the Reporter object. This throws away all the other listeners first. It behaves like: clearReporters(); addReporter(reporter);


report

public Measurement report(Measurement m)
Receiver of a measurement, with the measurement. It passes the Measurement on to all of the Reporters.

Specified by:
report in interface MeasurementReceiver

run

public void run()
The thread body. It sends stuff from the queue onto the Reporters.

Specified by:
run in interface java.lang.Runnable

addReporter

public void addReporter(Reporter l)
Add a Reporter.


removeReporter

public void removeReporter(Reporter l)
Remove a Reporter.


getReporters

public java.lang.Object[] getReporters()
List all Reporters.


getReporterCount

public int getReporterCount()
Count the Reporters.


clearReporters

public void clearReporters()
Clear away all the Reporters.


beginThreadBody

public void beginThreadBody()
The code to run at the begining of the thread body. Used to set things up.


endThreadBody

public void endThreadBody()
The code to run at the end of the thread body. Used to tidy things up.



RESERVOIR Monitoring 0.6.4