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.cybernode
Class ServiceCostCalculator

    java.lang.Object
      org.jini.rio.cybernode.ServiceCostCalculator

    public class ServiceCostCalculator

extends Object

Used to calculate resource costs for a service.

Constructor Summary
`ServiceCostCalculator()`

Method Summary
`ResourceCost[]` | `calculateCosts(long duration)` Calculate ResourceCost instances for cpu, memory, matched platform capabilities and software downloads
`void` | `setComputeResource(ComputeResource computeResource)` Set the ComputeResource
`void` | `setDownloadRecords(SoftwareDownloadRecord[] downloadRecords)` Set SoftwareDownloadRecord instances
`void` | `setServiceBeanContext(ServiceBeanContext context)` Set the ServiceBeanContext

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

Constructor Detail

### ServiceCostCalculator

    public ServiceCostCalculator()

Method Detail

### setComputeResource

    public void setComputeResource(ComputeResource computeResource)

  Set the ComputeResource

  Parameters:
    `computeResource` - The ComputeResource object, used to access resource cost producers

### setServiceBeanContext

    public void setServiceBeanContext(ServiceBeanContext context)

  Set the ServiceBeanContext

  Parameters:
    `context` - The ServiceBeanContext. This is used to assist in creating ResourceCost objects for any matched platform cCapability declarations.

### setDownloadRecords

    public void setDownloadRecords(SoftwareDownloadRecord[] downloadRecords)

  Set SoftwareDownloadRecord instances

  Parameters:
    `downloadRecords` - An array of SoftwareDownloadRecord instances, documenting that software bundles have been installed onto the compute resource. Each SoftwareDownloadRecord will be used to compute a ResourceCost for disk space use.

### calculateCosts

    public ResourceCost[] calculateCosts(long duration)

  Calculate ResourceCost instances for cpu, memory, matched platform capabilities and software downloads

  Parameters:
    `duration` - The time between cost calculations
  Returns:
    An array of ResourceCost objects containing at least a ResourceCost for cpu and memory.
    - Both cpu and memory resource costs are computed as the mean of the calculated utilizations each respective `MeasurableCapability` has recorded over the time period provided.
    - For each matched `PlatformCapability` class a ResourceCost is added.
    - If there are SoftwareDownloadRecord instances, a ResourceCost for disk space use is computed using the size of the downloadS() after extraction.

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.