Rio Project 4.2 API Documentation



org.rioproject.system
Class ComputeResource.CapabilityChannel

java.lang.Object
  extended by org.rioproject.system.ComputeResource.CapabilityChannel
All Implemented Interfaces:
Runnable, Observer
Enclosing class:
ComputeResource

public class ComputeResource.CapabilityChannel
extends Object
implements Observer, Runnable

The CapabilityChannel is an inner class that becomes an Observer to MeasurableCapability components and ends up notifying the ComputeResource to update registered Observer instances if any MeasurableCapability components have changed their state within the interval prescribed for the broadcaster


Field Summary
static long DEFAULT_REPORT_INTERVAL
           
 
Constructor Summary
ComputeResource.CapabilityChannel()
           
 
Method Summary
 long getReportInterval()
          Get the update interval for channelThread notification
 void run()
          Thread that will update the ComputeResource to notify Observer instances if any MeasurableCapability have updated their state in the interval provided.
 void setReportInterval(long reportInterval)
          Set the update interval for channelThread notification
 void subscribe(MeasurableCapability capability)
          Subscribe to a MeasurableCapability
 void terminate()
          Stop the CapabilityChannel channelThread
 void unsubscribe(MeasurableCapability capability)
          Unsubscribe from a MeasurableCapability
 void update(Observable o, Object arg)
          Notification that concrete implementation(s) of the MeasurableCapability have changed their state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REPORT_INTERVAL

public static final long DEFAULT_REPORT_INTERVAL
See Also:
Constant Field Values
Constructor Detail

ComputeResource.CapabilityChannel

public ComputeResource.CapabilityChannel()
Method Detail

terminate

public void terminate()
Stop the CapabilityChannel channelThread


setReportInterval

public void setReportInterval(long reportInterval)
Set the update interval for channelThread notification

Parameters:
reportInterval - The update interval for channelThread notification

getReportInterval

public long getReportInterval()
Get the update interval for channelThread notification

Returns:
The update interval for channelThread notification

subscribe

public void subscribe(MeasurableCapability capability)
Subscribe to a MeasurableCapability

Parameters:
capability - A MeasurableCapability

unsubscribe

public void unsubscribe(MeasurableCapability capability)
Unsubscribe from a MeasurableCapability

Parameters:
capability - A MeasurableCapability

update

public void update(Observable o,
                   Object arg)
Notification that concrete implementation(s) of the MeasurableCapability have changed their state. As these notifications arise they will cause a chained reaction to occur, that is all listeners (Observers) of the ComputeResource object will be notified as well

Specified by:
update in interface Observer

run

public void run()
Thread that will update the ComputeResource to notify Observer instances if any MeasurableCapability have updated their state in the interval provided. If a change has been made, inform the ComputeResource and reset the hasChanged attribute

Specified by:
run in interface Runnable

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.