Rio Project 4.2 API Documentation



org.rioproject.system.capability.platform
Class ByteOrientedDevice

java.lang.Object
  extended by org.rioproject.system.capability.PlatformCapability
      extended by org.rioproject.system.capability.platform.ByteOrientedDevice
All Implemented Interfaces:
Serializable, ResourceCostProducer, PlatformCapabilityMBean
Direct Known Subclasses:
Memory, StorageCapability

public class ByteOrientedDevice
extends PlatformCapability

Represents a capability that has a capacity thats measured in bytes

Author:
Dennis Reedy
See Also:
Serialized Form

Field Summary
static String AVAILABLE
          Available resource units (in bytes)
static String CAPACITY
          Resource capacity (in bytes)
static double GB
          Gigabytes
static double KB
          Kilobytes
static double MB
          Megabytes
static double TB
          Terabytes
 
Fields inherited from class org.rioproject.system.capability.PlatformCapability
capabilities, description, DESCRIPTION, logger, MANUFACTURER, MODEL, NAME, NATIVE_LIBS, PROVISIONABLE, STATIC, VENDOR, VERSION
 
Constructor Summary
ByteOrientedDevice()
           
 
Method Summary
 void define(String key, Object value)
          Override parents define method to create values for capacity and available
protected  boolean evaluate(String input, double val)
          Evaluate the input against a measures amount.
 boolean supports(SystemRequirements.SystemComponent requirement)
          Override supports to ensure that requirements are supported
 
Methods inherited from class org.rioproject.system.capability.PlatformCapability
addDownloadRecord, addStagedSoftware, calculateResourceCost, clearAll, decrementUsage, defineAll, equals, getCapabilities, getClassPath, getConfigurationFile, getDescription, getDownloadRecords, getLoadableClassPath, getName, getPath, getPlatformKeys, getResourceCostModel, getStagedSoftware, getType, getUsageCount, getValue, hasBasicSupport, hashCode, incrementUsage, loadResources, matches, remove, setClassPath, setConfigurationFile, setDescription, setPath, setResourceCostModel, setType, supports, toString, versionSupported
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AVAILABLE

public static final String AVAILABLE
Available resource units (in bytes)

See Also:
Constant Field Values

CAPACITY

public static final String CAPACITY
Resource capacity (in bytes)

See Also:
Constant Field Values

KB

public static final double KB
Kilobytes

See Also:
Constant Field Values

MB

public static final double MB
Megabytes


GB

public static final double GB
Gigabytes


TB

public static final double TB
Terabytes

Constructor Detail

ByteOrientedDevice

public ByteOrientedDevice()
Method Detail

define

public void define(String key,
                   Object value)
Override parents define method to create values for capacity and available

Overrides:
define in class PlatformCapability
Parameters:
key - The key associated with the platform capability. Can be a name or another descriptive attribute used to uniquely identify the platform capability
value - The value associated with the platform capability key

supports

public boolean supports(SystemRequirements.SystemComponent requirement)
Override supports to ensure that requirements are supported

Overrides:
supports in class PlatformCapability
Parameters:
requirement - The requirement to test
Returns:
True if they are, false if not
See Also:
PlatformCapability.supports(org.rioproject.system.capability.PlatformCapability)

evaluate

protected boolean evaluate(String input,
                           double val)
Evaluate the input against a measures amount. Based on the

Parameters:
input - The value of either the CAPACITY or the AVAILABLE key. Must end in 'm' or 'M' for megabytes, 'k' or 'K' for kilobytes, 'g' or 'G' for gigabytes, and 't' or 'T' for terabytes
val - The measured value, either the total or the available property
Returns:
True if the amount requested can be supported, or false if not

Copyright © Rio Project.

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