Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.qos.measurable
Class MeasurableCapability

    java.lang.Object
      org.jini.rio.watch.Watch
          org.jini.rio.watch.ThresholdWatch
              org.jini.rio.watch.PeriodicWatch
                  org.jini.rio.qos.measurable.MeasurableCapability

All Implemented Interfaces:
  ResourceCostProducer, MeasurableCapabilityMBean, PeriodicWatchMBean, ThresholdWatchMBean, WatchMBean

Direct Known Subclasses:
  CPU, DiskSpace, Memory

    public abstract class MeasurableCapability

extends PeriodicWatch
implements ResourceCostProducer, MeasurableCapabilityMBean

A MeasurableCapability refers to a depletion oriented resource or capability on a ComputeResource

Field Summary
`protected int` | `sampleSize` The sampleSize property specifies the amount of samples the MeasurableCapability will accumulate in the period defined by the reportRate in order to produce a result.

Fields inherited from class org.jini.rio.watch.PeriodicWatch
`DEFAULT_PERIOD`

Fields inherited from class org.jini.rio.watch.Watch
`DEFAULT_VIEW, id, localRef, logger, watchDataSource`

Constructor Summary
`protected` | `MeasurableCapability(String id, String componentName, Configuration config)`

Method Summary
`void` | `addSecondaryThresholdManager(ThresholdManager thresholdManager)` Add a secondary ThresholdManager to the MeasurableCapability.
`void` | `addWatchRecord(Calculable record)` Add a Calculable to the watch and update state
`ResourceCost` | `calculateResourceCost(double units, long duration)` Calculate the cost based on the units provided.
`Configuration` | `getConfiguration()` Get the Configuration property
`MeasuredResource` | `getMeasuredResource()` Get the MeasuredResource object, which represents this object's measured capability
`Observable` | `getObservable()` Get the Observable instance
`int` | `getSampleSize()` Get the sampleSize property
`SLA` | `getSLA()` Get the SLA for ths MeasurableCapability.
`void` | `removeSecondaryThresholdManager(ThresholdManager thresholdManager)` Remove a secondary ThresholdManager from the MeasurableCapability
`void` | `setResourceCostModel(ResourceCostModel costModel)` Set the ResourceCostModel for the MeasurableCapability
`void` | `setSampleSize(int sampleSize)` Set the sampleSize for the MeasurableCapability
`void` | `setSLA(SLA sla)` Set the SLA for ths MeasurableCapability.
`void` | `setWatchDataSource(WatchDataSource watchDataSource)` Override parent's setWatchDataSource to set the size

Methods inherited from class org.jini.rio.watch.PeriodicWatch
`getPeriod, setPeriod, start, stop`

Methods inherited from class org.jini.rio.watch.ThresholdWatch
`addThresholdListener, getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, getThresholdManager, getThresholdValues, removeThresholdListener, setCurrentHighThreshold, setCurrentLowThreshold, setThresholdValues`

Methods inherited from class org.jini.rio.watch.Watch
`clear, equals, getCalculables, getId, getLastCalculableValue, getView, getWatchDataSource, hashCode, main, setView, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.jini.rio.qos.measurable.MeasurableCapabilityMBean
`getUtilization`

Methods inherited from interface org.jini.rio.watch.PeriodicWatchMBean
`checkValue, getPeriod, setPeriod, start, stop`

Methods inherited from interface org.jini.rio.watch.ThresholdWatchMBean
`getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, setCurrentHighThreshold, setCurrentLowThreshold`

Methods inherited from interface org.jini.rio.watch.WatchMBean
`clear, getCalculables, getId, getLastCalculableValue`

Field Detail

### sampleSize

    protected int sampleSize

  The sampleSize property specifies the amount of samples the MeasurableCapability will accumulate in the period defined by the reportRate in order to produce a result.

Constructor Detail

### MeasurableCapability

    protected MeasurableCapability(String id,
                                   String componentName,
                                   Configuration config)

Method Detail

### getConfiguration

    public Configuration getConfiguration()

  Get the Configuration property

  Returns:
    The configuration for the MeasurableCapability

### setWatchDataSource

    public void setWatchDataSource(WatchDataSource watchDataSource)

  Override parent's setWatchDataSource to set the size

  Overrides:
    `setWatchDataSource` in class `Watch`
  Parameters:
    `watchDataSource` - The new watchDataSource.

### setSLA

    public void setSLA(SLA sla)

  Set the SLA for ths MeasurableCapability.

  Parameters:
    `sla` - The SLA for this MeasurableCapability

### getSLA

    public SLA getSLA()

  Get the SLA for ths MeasurableCapability.

  Returns:
    The SLA for this MeasurableCapability

### setSampleSize

    public void setSampleSize(int sampleSize)

  Description copied from interface: `MeasurableCapabilityMBean`
  Set the sampleSize for the MeasurableCapability

  Specified by:
    `setSampleSize` in interface `MeasurableCapabilityMBean`
  Parameters:
    `sampleSize` - The number of samples the MeasurableCapability will accumulate in the period defined by the period in order to produce a result.
  See Also:
    `MeasurableCapabilityMBean.setSampleSize(int)`

### getSampleSize

    public int getSampleSize()

  Description copied from interface: `MeasurableCapabilityMBean`
  Get the sampleSize property

  Specified by:
    `getSampleSize` in interface `MeasurableCapabilityMBean`
  Returns:
    The number of samples the MeasurableCapability will accumulate in the period defined by the period in order to produce a result.
  See Also:
    `MeasurableCapabilityMBean.getSampleSize()`

### addSecondaryThresholdManager

    public void addSecondaryThresholdManager(ThresholdManager thresholdManager)

  Add a secondary ThresholdManager to the MeasurableCapability. The primary ThresholdManager and the ThresholdValues are set when this class is loaded. By offering secondary ThresholdManager instances, services can set their own ranges and be notified accordingly

  Parameters:
    `thresholdManager` - The ThresholdManager

### removeSecondaryThresholdManager

    public void removeSecondaryThresholdManager(ThresholdManager thresholdManager)

  Remove a secondary ThresholdManager from the MeasurableCapability

  Parameters:
    `thresholdManager` - The ThresholdManager

### setResourceCostModel

    public void setResourceCostModel(ResourceCostModel costModel)

  Set the ResourceCostModel for the MeasurableCapability

  Parameters:
    `costModel` - The ResourceCostModel which will determine the cost of using this MeasurableCapability

### calculateResourceCost

    public ResourceCost calculateResourceCost(double units,
                                              long duration)

  Description copied from interface: `ResourceCostProducer`
  Calculate the cost based on the units provided. The cost will be computed using the ResourceCostModel

  Specified by:
    `calculateResourceCost` in interface `ResourceCostProducer`
  Parameters:
    `units` - The units to be costed
    `duration` - The amount of time in milliseconds the resource has been used for
  Returns:
    A ResourceCost object
  See Also:
    `ResourceCostProducer.calculateResourceCost(double, long)`

### getMeasuredResource

    public MeasuredResource getMeasuredResource()

  Get the MeasuredResource object, which represents this object's measured capability

  Returns:
    This object's measured capability

### addWatchRecord

    public void addWatchRecord(Calculable record)

  Add a Calculable to the watch and update state

  Overrides:
    `addWatchRecord` in class `ThresholdWatch`
  Parameters:
    `record` - A Calculable record

### getObservable

    public Observable getObservable()

  Get the Observable instance

  Returns:
    The object to subscribe for changes in MeasurableCapability state

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.