Rio Project 4.2 API Documentation
org.rioproject.monitor
Class ResourceCostSelector
java.lang.Object
org.rioproject.monitor.ServiceResourceSelector
org.rioproject.monitor.ResourceCostSelector
- All Implemented Interfaces:
- LeaseListener
public class ResourceCostSelector
- extends ServiceResourceSelector
This class provides an implementation of a ServiceResourceSelector which
manages a TreeSet of ServiceResource objects
which reflect the resources being leased. This class organizes list items in
a sorted collection. The natural order of the collection will be used to
obtain a ServiceResource element if it can accept the
resources capabilities.
This class must be registered with the LandlordLessor, and
will be notified as resources are lease, updated or removed
- Author:
- Dennis Reedy
- See Also:
LandlordLessor,
ResourceLessor,
ComputeResource,
ResourceCapability
|
Nested Class Summary |
static class |
ResourceCostSelector.CostComparator
The CostComparator is a Comparator which
sorts the Collection based on the Comparable
implementation of the ResourceCapability |
|
Method Summary |
void |
serviceResourceSelected(ServiceResource svcResource)
This method allows concrete implementations of this class to order the
Collection of ServiceResource instances based on a ServiceResource being
selected |
protected void |
update(LeasedResource resource)
Override parent's update method to provide proper TreeSet
behavior |
| Methods inherited from class org.rioproject.monitor.ServiceResourceSelector |
add, expired, getServiceResource, getServiceResource, getServiceResources, register, remove, removed, renewed, selectServiceResource, setLandlordLessor |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceCostSelector
public ResourceCostSelector()
- Construct a ResourceCostSelector
serviceResourceSelected
public void serviceResourceSelected(ServiceResource svcResource)
- Description copied from class:
ServiceResourceSelector
- This method allows concrete implementations of this class to order the
Collection of ServiceResource instances based on a ServiceResource being
selected
- Specified by:
serviceResourceSelected in class ServiceResourceSelector
- Parameters:
svcResource - A ServiceResource instance selected for provisioning a
ServiceBean- See Also:
ServiceResourceSelector.serviceResourceSelected(org.rioproject.resources.servicecore.ServiceResource)
update
protected void update(LeasedResource resource)
- Override parent's update method to provide proper
TreeSet
behavior
- Overrides:
update in class ServiceResourceSelector
- Parameters:
resource - The LeasedResource
Copyright © 2006-2011 Rio Project. All Rights Reserved.