|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.monitor.ServiceResourceSelector
public abstract class ServiceResourceSelector
This abstract class defines the semantics for selecting a
ServiceResource based on requirements contained within a
ServiceElement. Additionally, this interface defines
semantics for the removal and snapshot retrieval of
ServiceResource objects under its control.
Objects which implement this interface will need to create a
Collection to manage the ServiceResource
elements it is notified of. The managed Collection will back
the Collection of ServiceResource elements
which are leased and managed by the LandlordLessor
The LandlordLessor will send notifications of the following:
It is the responsibility of the entity to register with the
LandlordLessor. The object that implements this interface
should define the actions to take upon receipt of such notifications
Concrete implementations of this class must provide a zero-argument constructor in order to be instantiated by the ProvisionMonitor
| Field Summary | |
|---|---|
protected Collection<LeasedResource> |
collection
The collection of ServiceResource objects to manage |
protected Object |
collectionLock
|
protected LandlordLessor |
landlord
The LandlordLessor which will be registered to, and will provide Lease notification events |
| Constructor Summary | |
|---|---|
ServiceResourceSelector()
|
|
| Method Summary | |
|---|---|
protected void |
add(LeasedResource resource)
If the Collection backed by the concrete class requires
processing other then that defined by Collection.add
override this method to provide the appropriate semantics |
void |
expired(LeasedResource resource)
Notifies the manager of a lease expiration |
ServiceResource |
getServiceResource(ServiceElement sElem)
This method will attempt to identify an available ServiceResource based on the operational criteria
specified by a ServiceBean |
ServiceResource |
getServiceResource(ServiceElement sElem,
Uuid uuid,
boolean inclusive)
This method will attempt to identify an available ServiceResource based on the operational criteria
specified by a ServiceBean |
ServiceResource[] |
getServiceResources(ServiceElement sElem)
Get all available ServiceResource instances that support
the ServiceElement object's contained requirement
specifications |
void |
register(LeasedResource resource)
Notifies the manager of a new lease being created. |
protected void |
remove(LeasedResource resource)
If the Collection backed by the concrete class requires
processing other then that defined by Collection.remove
override this method to provide the appropriate semantics |
void |
removed(LeasedResource resource)
Notifies the manager of a lease removal |
void |
renewed(LeasedResource resource)
Notifies the manager of a lease being renewed. |
protected ServiceResource |
selectServiceResource(ServiceElement sElem,
ServiceResource[] svcResources)
Select a ServiceResource for dynamic ServiceBean provisioning based on the operational criteria of a ServiceBean |
abstract void |
serviceResourceSelected(ServiceResource resource)
This method allows concrete implementations of this class to order the Collection of ServiceResource instances based on a ServiceResource being selected |
void |
setLandlordLessor(LandlordLessor landlord)
Set the LandlordLessor the
ServiceResourceSelector will register to. |
protected void |
update(LeasedResource resource)
If the Collection backed by the concrete class requires
processing other then that defined by Collection.add
override this method to provide the appropriate semantics |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Collection<LeasedResource> collection
protected final Object collectionLock
protected LandlordLessor landlord
| Constructor Detail |
|---|
public ServiceResourceSelector()
| Method Detail |
|---|
public void setLandlordLessor(LandlordLessor landlord)
LandlordLessor the
ServiceResourceSelector will register to.
landlord - The LandlordLessor
public ServiceResource getServiceResource(ServiceElement sElem)
throws Exception
ServiceResource based on the operational criteria
specified by a ServiceBean
sElem - The ServiceElement
ServiceResource object can
be identified, return the ServiceResource, otherwise
return null
Exception - If there are errors getting a ServiceResource
public ServiceResource getServiceResource(ServiceElement sElem,
Uuid uuid,
boolean inclusive)
throws Exception
ServiceResource based on the operational criteria
specified by a ServiceBean
sElem - The ServiceElementuuid - The Uuid of the InstantiatorResource to either include or
not includeinclusive - Either include or exclude the uuid from the selection.
If true, include the uuid otherwise exclude the uuid
ServiceResource object can
be identified, otherwise return null
Exception - if any errors occur selecting a resource
protected ServiceResource selectServiceResource(ServiceElement sElem,
ServiceResource[] svcResources)
throws ProvisionException
sElem - The ServiceElementsvcResources - Array ServiceResource candidates
ServiceResource object can
be identified, otherwise return null
ProvisionException - If there are unrecoverable errors
provisioning the servicepublic abstract void serviceResourceSelected(ServiceResource resource)
resource - A ServiceResource instance selected for provisioning a
ServiceBean
public ServiceResource[] getServiceResources(ServiceElement sElem)
throws ProvisionException
ServiceResource instances that support
the ServiceElement object's contained requirement
specifications
sElem - The ServiceElement
ProvisionException - If there are unrecoverable errors
provisioning the servicepublic void expired(LeasedResource resource)
expired in interface LeaseListenerresource - The resource associated with the expirationpublic void removed(LeasedResource resource)
removed in interface LeaseListenerresource - The resource associated with the removalpublic void register(LeasedResource resource)
register in interface LeaseListenerresource - The resource associated with the new Lease.public void renewed(LeasedResource resource)
renewed in interface LeaseListenerresource - The resource associated with the new Lease.protected void add(LeasedResource resource)
Collection backed by the concrete class requires
processing other then that defined by Collection.add
override this method to provide the appropriate semantics
resource - The LeasedResource to addprotected void remove(LeasedResource resource)
Collection backed by the concrete class requires
processing other then that defined by Collection.remove
override this method to provide the appropriate semantics
resource - The LeasedResource to removeprotected void update(LeasedResource resource)
Collection backed by the concrete class requires
processing other then that defined by Collection.add
override this method to provide the appropriate semantics
resource - The LeasedResource
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||