|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.rioproject.system.ComputeResource
public class ComputeResource
The ComputeResource represents an abstract notion of a compute
resource that offers computational resources which can be measured using Quality
of Service mechanisms which correlate to qualitative and quantitative capabilities
such as CPU, Memory, and others
| Nested Class Summary | |
|---|---|
class |
ComputeResource.CapabilityChannel
The CapabilityChannel is an inner class that becomes an Observer to MeasurableCapability components and ends up notifying the ComputeResource to update registered Observer instances if any MeasurableCapability components have changed their state within the interval prescribed for the broadcaster |
| Constructor Summary | |
|---|---|
ComputeResource()
Create a ComputeResource with a default (empty) configuration |
|
ComputeResource(Configuration config)
Create a ComputeResource |
|
| Method Summary | |
|---|---|
boolean |
addMeasurableCapability(MeasurableCapability capability)
Add a MeasurableCapability object. |
void |
addPlatformCapability(PlatformCapability pCap)
Add a PlatformCapability object. |
void |
addThresholdListener(ThresholdListener listener)
A helper method which will add a ThresholdListener to all
contained MeasurableCapability components. |
void |
boot()
Boot the ComputeResource, loading all PlatformCapability and MeasurableCapability instances |
InetAddress |
getAddress()
Get the InetAddress ComputeResource object has been configured to represent |
ComputeResourceUtilization |
getComputeResourceUtilization()
Get the ComputeResourceUtilization |
String |
getDescription()
Get the description |
MeasurableCapability[] |
getMeasurableCapabilities()
Return an array of MeasurableCapability objects. |
MeasurableCapability |
getMeasurableCapability(String description)
Get a MeasurableCapability |
MeasuredResource[] |
getMeasuredResources()
Get the MeasuredResource components for the ComputeResource |
boolean |
getPersistentProvisioning()
Get the persistentProvisioning property |
String |
getPersistentProvisioningRoot()
Get the location for the persistent provisioning of PlatformCapability instances |
PlatformCapability[] |
getPlatformCapabilities()
Return an array of PlatformCapability objects. |
PlatformCapability |
getPlatformCapability(String name)
Get a PlatformCapability |
Map<String,String> |
getPlatformCapabilityNameTable()
Get the PlatformCapability name table |
long |
getReportInterval()
Get the reportInterval property which controls how often the ComputeResource will inform registered Observers of a state change. |
ResourceCapability |
getResourceCapability()
Return the ResourceCapabilityobject that will be used to
communicate the platform and measurable capabilities attributes of the
ComputeResource |
double |
getUtilization()
Get the resource utilization as computed by a summation of the MeasurableCapability components |
boolean |
hasMeasurableCapability(MeasurableCapability capability)
Determine if the MeasurableCapability exists in this ComputeResource |
boolean |
hasPlatformCapability(PlatformCapability capability)
Determine if the PlatformCapability exists in this ComputeResource |
DownloadRecord[] |
provision(PlatformCapability pCap,
StagedSoftware stagedSoftware)
Provision a StagedSoftware for a
PlatformCapability object. |
boolean |
removalInProcess(PlatformCapability pCap)
Determine if a PlatformCapability
is being removed from the system. |
boolean |
removeMeasurableCapability(MeasurableCapability capability)
Remove a MeasurableCapability object. |
boolean |
removePlatformCapability(PlatformCapability pCap,
boolean clean)
Remove a PlatformCapability object. |
void |
removeThresholdListener(ThresholdListener listener)
A helper method which will remove a ThresholdListener from all
contained MeasurableCapability components. |
void |
setPersistentProvisioning(boolean persistentProvisioning)
Set the persistentProvisioning property |
void |
setPersistentProvisioningRoot(String provisionRoot)
Set the location for the persistent provisioning of PlatformCapability instances |
void |
setReportInterval(long reportInterval)
Set the reportInterval property which controls how often the ComputeResource will inform registered Observers of a state change. |
void |
shutdown()
Inform all MeasurableCapability instances to stop measuring |
void |
stateChange()
Notify all registered Observers the ComputeResource has changed. |
void |
updateMeasurableCapability(MeasurableCapability capability)
Update a MeasurableCapability object. |
void |
updatePlatformCapability(PlatformCapability capability)
Update a PlatformCapability object. |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComputeResource()
throws ConfigurationException,
UnknownHostException
ConfigurationException - If there are problems accessing the
ComputeResource's configuration object
UnknownHostException - If the local host cannot be obtained
public ComputeResource(Configuration config)
throws ConfigurationException,
UnknownHostException
config - The Configuration used to initialize the ComputeResource
ConfigurationException - If there are problems accessing the
ComputeResource's configuration object
UnknownHostException - If the local host cannot be obtained
IllegalArgumentException - If the config is null| Method Detail |
|---|
public void setReportInterval(long reportInterval)
reportInterval - The interval controlling when the ComputeResource
reports change of state to registered Observerspublic long getReportInterval()
public String getDescription()
public InetAddress getAddress()
public void addPlatformCapability(PlatformCapability pCap)
PlatformCapability object. The addition of a
PlatformCapability component causes the state of this object
to change, triggering the notification of all registered
Observer instances.
If there is a PlatformCapability component that is equal to
the provided PlatformCapability (according to the
PlatformCapability.equals() contract), the existing
PlatformCapability object will be remain unchanged and
the provided PlatformCapability ignored
pCap - The PlatformCapability to add
public DownloadRecord[] provision(PlatformCapability pCap,
StagedSoftware stagedSoftware)
StagedSoftware for a
PlatformCapability object. The
provisioning of StagedSoftware
object for aPlatformCapability
component causes the state of this object to change, triggering the
notification of all registered Observer instances.
If there is a PlatformCapability component that is equal to the provided PlatformCapability (according to the PlatformCapability.equals() contract), the existing PlatformCapability object will be changed. If the PlatformCapability object does not exist, it will be added
pCap - The PlatformCapabilitystagedSoftware - StagedSoftware to provision for the
PlatformCapability
public boolean hasPlatformCapability(PlatformCapability capability)
capability - The PlatformCapability to check
public void updatePlatformCapability(PlatformCapability capability)
throws Exception
PlatformCapability object. Updating a
PlatformCapability component has the following semantic:
If the PlatformCapability object Class exists
in the collection of PlatformCapability components, the
existing PlatformCapability will be updated with the new
PlatformCapability mappings. If the
PlatformCapability object Class cannot be found,
it will be added to the collection.
Updating a PlatformCapability component causes the state of
this object to change, triggering the notification of all registered
Observer instances
capability - The PlatformCapability to add
Exception - If there are errors updating the PlatformCapability
public boolean removePlatformCapability(PlatformCapability pCap,
boolean clean)
PlatformCapability object. The removal of a
PlatformCapability component causes the state of this object to
change, triggering the notification of all registered Observer
instances
pCap - The PlatformCapability to removeclean - If this value is true and if the PlatformCapability has a
DownloadRecord defined (was provisioned during the time this Cybernode
was running) then remove the PlatformCapability from the system.
public boolean removalInProcess(PlatformCapability pCap)
PlatformCapability
is being removed from the system. This will occur for provisioned
PlatformCapability instances that are removed as a result of
service termination.
pCap - The PlatformCapability to check
public boolean addMeasurableCapability(MeasurableCapability capability)
MeasurableCapability object. The addition of a
MeasurableCapability component causes the state of this object
to change, triggering the notification of all registered Observer
instances.
If there is a MeasurableCapability component that is equal
to the provided MeasurableCapability (according to the
MeasurableCapability.equals() contract), the existing
MeasurableCapability object will be remain unchanged and
the provided MeasurableCapability ignored
capability - The MeasurableCapability to add
public boolean hasMeasurableCapability(MeasurableCapability capability)
capability - The MeasurableCapability to check
public void updateMeasurableCapability(MeasurableCapability capability)
MeasurableCapability object. Updating a
MeasurableCapability component causes the state of this object
to change, triggering the notification of all registered
Observer instances.
If there is a MeasurableCapability object that is equal to
the provided MeasurableCapability (according to the
MeasurableCapability.equals() contract), the existing
MeasurableCapability object will be replaced by the
provided MeasurableCapability object
capability - The MeasurableCapability to updatepublic boolean removeMeasurableCapability(MeasurableCapability capability)
MeasurableCapability object. The removal of a
MeasurableCapability component causes the state of this object
to change, triggering the notification of all registered
Observer instances
capability - The MeasurableCapability to remove
public void stateChange()
public void addThresholdListener(ThresholdListener listener)
ThresholdListener to all
contained MeasurableCapability components. An alternate
mechanism is to obtain all MeasurableCapability components
contained by the ComputeResource and add the listener to each
component
listener - The ThresholdListener to addpublic void removeThresholdListener(ThresholdListener listener)
ThresholdListener from all
contained MeasurableCapability components. An alternate mechanism
is to obtain all MeasurableCapability components contained by
the ComputeResource and remove the listener from each component
listener - The ThresholdListenerpublic PlatformCapability[] getPlatformCapabilities()
PlatformCapability objects. This method will
create a new array of PlatformCapability objects each time it
is invoked. If there are no PlatformCapability objects contained
within the platformCapabilities Collection, a zero-length array
will be returned.
public PlatformCapability getPlatformCapability(String name)
name - The name of the PlatformCapability
PlatformCapability.NAMEpublic Map<String,String> getPlatformCapabilityNameTable()
public MeasurableCapability getMeasurableCapability(String description)
description - The description of the MeasurableCapability
public MeasurableCapability[] getMeasurableCapabilities()
MeasurableCapability objects. This method
will create a new array of MeasurableCapability objects each
time it is invoked. If there are no MeasurableCapability
objects contained within the measurables Collection, a
zero-length array will be returned.
public MeasuredResource[] getMeasuredResources()
public double getUtilization()
public void setPersistentProvisioning(boolean persistentProvisioning)
persistentProvisioning - True if the ComputeResource supports
persistent provisioning, false otherisepublic boolean getPersistentProvisioning()
public String getPersistentProvisioningRoot()
public void setPersistentProvisioningRoot(String provisionRoot)
provisionRoot - The root directory for the persistent provisioning of
PlatformCapability instancespublic ResourceCapability getResourceCapability()
ResourceCapabilityobject that will be used to
communicate the platform and measurable capabilities attributes of the
ComputeResource
public ComputeResourceUtilization getComputeResourceUtilization()
public void boot()
public void shutdown()
MeasurableCapability instances to stop measuring
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||