Rio Project 4.2 API Documentation



org.rioproject.system
Class MeasuredResource

java.lang.Object
  extended by org.rioproject.system.MeasuredResource
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CpuUtilization, DiskSpaceUtilization, MemoryPoolUtilization, ProcessCpuUtilization, ProcessMemoryUtilization, SystemMemoryUtilization

public class MeasuredResource
extends Object
implements Serializable

The MeasuredResource represents a quantitative value of a resource that has been measured

Author:
Dennis Reedy
See Also:
Serialized Form

Constructor Summary
MeasuredResource(String identifier, double value, ThresholdValues tVals)
          Construct a MeasuredResource with parameters
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 boolean evaluate(ThresholdValues thresholdValue)
          Evaluates whether the MeasuredResource can meet the criteria specified by the ThresholdValues object.
 String getIdentifier()
          Get the identifier of the measurable resource
 ThresholdValues getThresholdValues()
          Get the ThresholdValues property
 double getValue()
          Get the measured value
 int hashCode()
          Returns a hash code value for the object.
 boolean thresholdCrossed()
          Determine if the value has crossed a threshold declared in the ThresholdValues property
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeasuredResource

public MeasuredResource(String identifier,
                        double value,
                        ThresholdValues tVals)
Construct a MeasuredResource with parameters

Parameters:
identifier - Identifier for the MeasurableResource
value - The measured value
tVals - ThresholdValues for the MeasurableResource
Method Detail

getValue

public double getValue()
Get the measured value

Returns:
The measured value

getIdentifier

public String getIdentifier()
Get the identifier of the measurable resource

Returns:
String identifier of the measurable resource

getThresholdValues

public ThresholdValues getThresholdValues()
Get the ThresholdValues property

Returns:
The ThresholdValues for the MeasuredResource at the time of the measurement

thresholdCrossed

public boolean thresholdCrossed()
Determine if the value has crossed a threshold declared in the ThresholdValues property

Returns:
True if the value falls within the range declared by the ThresholdValues, false if the value exceeds either the lower or upper range values

evaluate

public boolean evaluate(ThresholdValues thresholdValue)
Evaluates whether the MeasuredResource can meet the criteria specified by the ThresholdValues object.

Parameters:
thresholdValue - The ThresholdValue to evaluate
Returns:
boolean true if the MeasuredResource can meet the criteria specified by the ThresholdValues object, otherwise false

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
obj - the object to compare to this one
Returns:
true if the objects are equal

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Returns:
a hash code value for the object.

toString

public String toString()
Overrides:
toString in class Object

Copyright © Rio Project.

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