Rio Project 4.2 API Documentation



org.rioproject.system.measurable.cpu
Class CPUExecHandler

java.lang.Object
  extended by org.rioproject.system.measurable.cpu.CPUExecHandler
All Implemented Interfaces:
MeasurableMonitor<CpuUtilization>
Direct Known Subclasses:
MacTopOutputParser, MpstatOutputParser

public abstract class CPUExecHandler
extends Object
implements MeasurableMonitor<CpuUtilization>

The CPUExecHandler provides the basis for concrete implementations to execute and parse a command which produces CPU utilization values.

Author:
Dennis Reedy

Field Summary
protected  double utilization
          Utilization property
 
Constructor Summary
CPUExecHandler()
           
 
Method Summary
abstract  String getCommand()
          Get the command to execute
protected  ExecutorService getExecutorService()
          Get the ExecutorService
 CpuUtilization getMeasuredResource()
          Get the MeasuredResource
abstract  double getUtilization()
           
abstract  void parse(InputStream in)
           
 void setID(String id)
          Set the identifier for the resource being measured
 void setThresholdValues(ThresholdValues tVals)
          Set the ThresholdValues for the resource being measured
 void terminate()
          Terminate any collection mechanisms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

utilization

protected double utilization
Utilization property

Constructor Detail

CPUExecHandler

public CPUExecHandler()
Method Detail

getCommand

public abstract String getCommand()
Get the command to execute

Returns:
command the name of the command

parse

public abstract void parse(InputStream in)

getUtilization

public abstract double getUtilization()

getExecutorService

protected ExecutorService getExecutorService()
Get the ExecutorService

Returns:
The ExecutorService

setID

public void setID(String id)
Description copied from interface: MeasurableMonitor
Set the identifier for the resource being measured

Specified by:
setID in interface MeasurableMonitor<CpuUtilization>
Parameters:
id - The identifier

setThresholdValues

public void setThresholdValues(ThresholdValues tVals)
Description copied from interface: MeasurableMonitor
Set the ThresholdValues for the resource being measured

Specified by:
setThresholdValues in interface MeasurableMonitor<CpuUtilization>
Parameters:
tVals - The ThresholdValues

getMeasuredResource

public CpuUtilization getMeasuredResource()
Description copied from interface: MeasurableMonitor
Get the MeasuredResource

Specified by:
getMeasuredResource in interface MeasurableMonitor<CpuUtilization>
Returns:
The MeasuredResource for the MeasurableMonitor

terminate

public void terminate()
Description copied from interface: MeasurableMonitor
Terminate any collection mechanisms

Specified by:
terminate in interface MeasurableMonitor<CpuUtilization>

Copyright © Rio Project.

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