Rio Project 4.2 API Documentation



org.rioproject.system.measurable.memory
Class Memory

java.lang.Object
  extended by org.rioproject.watch.Watch
      extended by org.rioproject.watch.ThresholdWatch
          extended by org.rioproject.watch.PeriodicWatch
              extended by org.rioproject.system.measurable.MeasurableCapability
                  extended by org.rioproject.system.measurable.memory.Memory
All Implemented Interfaces:
ResourceCostProducer, MeasurableCapabilityMBean, PeriodicWatchMBean, ThresholdWatchMBean, WatchMBean
Direct Known Subclasses:
SystemMemory

public class Memory
extends MeasurableCapability

The Memory object is a MeasurableCapability that measures the amount of memory available for the JVM

Author:
Dennis Reedy

Field Summary
 
Fields inherited from class org.rioproject.system.measurable.MeasurableCapability
lastMeasured, monitor, sampleSize
 
Fields inherited from class org.rioproject.watch.PeriodicWatch
DEFAULT_PERIOD
 
Fields inherited from class org.rioproject.watch.Watch
DEFAULT_VIEW, id, localRef, watchDataSource
 
Constructor Summary
Memory(Configuration config)
          Construct a Memory object
Memory(String id, Configuration config)
          Construct a Memory object
Memory(String id, String componentName, Configuration config)
          Construct a Memory object
 
Method Summary
protected  double calculateUtilization(MeasuredResource mRes)
           
 void checkValue()
          Abstract method to check the watch's value at the periodic interval
protected  MeasurableMonitor createMeasurableMonitor(Configuration config)
           
protected  String getComponentName()
           
 MeasurableMonitor getMeasurableMonitor()
           
 double getUtilization()
          Get the computed utilization for this Memory object
 void start()
          Override PeriodicWatch.start() to get an initial reading prior to scheduling
 void stop()
          Stop the PeriodicWatch
 
Methods inherited from class org.rioproject.system.measurable.MeasurableCapability
addSecondaryThresholdManager, addWatchRecord, calculateResourceCost, getConfiguration, getMeasuredResource, getObservable, getSampleSize, getSLA, getThresholdManagers, isEnabled, removeSecondaryThresholdManager, setEnabled, setLastMeasuredResource, setMeasurableMonitor, setResourceCostModel, setSampleSize, setSLA, setWatchDataSource
 
Methods inherited from class org.rioproject.watch.PeriodicWatch
getPeriod, setPeriod
 
Methods inherited from class org.rioproject.watch.ThresholdWatch
addThresholdListener, getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, getThresholdManager, getThresholdValues, removeThresholdListener, setCurrentHighThreshold, setCurrentLowThreshold, setThresholdValues
 
Methods inherited from class org.rioproject.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.rioproject.watch.PeriodicWatchMBean
getPeriod, setPeriod
 
Methods inherited from interface org.rioproject.watch.ThresholdWatchMBean
getBreachedCount, getClearedCount, getCurrentHighThreshold, getCurrentLowThreshold, getHighThreshold, getLowThreshold, setCurrentHighThreshold, setCurrentLowThreshold
 
Methods inherited from interface org.rioproject.watch.WatchMBean
clear, getCalculables, getId, getLastCalculableValue
 

Constructor Detail

Memory

public Memory(Configuration config)
Construct a Memory object

Parameters:
config - Configuration object

Memory

public Memory(String id,
              Configuration config)
Construct a Memory object

Parameters:
id - Identifier to use
config - Configuration object

Memory

public Memory(String id,
              String componentName,
              Configuration config)
Construct a Memory object

Parameters:
id - Identifier to use
componentName - The configuration component name
config - Configuration object
Method Detail

getComponentName

protected String getComponentName()

createMeasurableMonitor

protected MeasurableMonitor createMeasurableMonitor(Configuration config)
                                             throws ConfigurationException
Throws:
ConfigurationException

getMeasurableMonitor

public MeasurableMonitor getMeasurableMonitor()

start

public void start()
Override PeriodicWatch.start() to get an initial reading prior to scheduling

Specified by:
start in interface PeriodicWatchMBean
Overrides:
start in class PeriodicWatch
See Also:
PeriodicWatchMBean.start()

stop

public void stop()
Description copied from interface: PeriodicWatchMBean
Stop the PeriodicWatch

Specified by:
stop in interface PeriodicWatchMBean
Overrides:
stop in class PeriodicWatch
See Also:
PeriodicWatchMBean.stop()

getUtilization

public double getUtilization()
Get the computed utilization for this Memory object

Returns:
The utilization computed for this component

checkValue

public void checkValue()
Description copied from interface: PeriodicWatchMBean
Abstract method to check the watch's value at the periodic interval


calculateUtilization

protected double calculateUtilization(MeasuredResource mRes)

Copyright © Rio Project.

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