Package com.sun.solaris.service.pools
Class Resource
- java.lang.Object
-
- com.sun.solaris.service.pools.Element
-
- com.sun.solaris.service.pools.Resource
-
- All Implemented Interfaces:
Property,PropertyWalk
public class Resource extends Element
TheResourceclass represents a resource.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Indicates whether some other Resource is "equal to this one.java.util.ListgetComponents(java.util.List values)Get a list of components which match the supplied selection criteria in values.protected longgetElem()Return the pointer to this resource as an element.java.lang.StringgetInformation(int deep)Returns a descriptive string which describes the resource.inthashCode()Returns a hash code value for the object.java.lang.StringtoString()Returns a string representation of this resource.voidtransfer(Resource donor, long qty)Transfer the requested quantity of resource from the donor to this resource.voidtransfer(Resource donor, java.util.List components)Transfer the specified resource components from the donor to this resource.-
Methods inherited from class com.sun.solaris.service.pools.Element
getBoolProperty, getDoubleProperty, getLongProperty, getProperty, getStringProperty, putProperty, rmProperty, walk, walkProperties
-
-
-
-
Method Detail
-
transfer
public void transfer(Resource donor, long qty) throws PoolsException
Transfer the requested quantity of resource from the donor to this resource.- Parameters:
donor- A donating resource.qty- Amount of resource to be donated.- Throws:
PoolsException- If there is an error whilst donating the resource.
-
transfer
public void transfer(Resource donor, java.util.List components) throws PoolsException
Transfer the specified resource components from the donor to this resource.- Parameters:
donor- A donating resource.components- A list of resource components to be donated.- Throws:
PoolsException- If there is an error whilst donating the resource components.
-
getComponents
public java.util.List getComponents(java.util.List values) throws PoolsExceptionGet a list of components which match the supplied selection criteria in values. Only components which are controlled by this resource are searched.- Parameters:
values- A list of values to be used to qualify the search.- Returns:
- a list of components which match the supplied criteria
- Throws:
PoolsException- If there is an error executing the query.
-
getInformation
public java.lang.String getInformation(int deep) throws PoolsExceptionReturns a descriptive string which describes the resource.- Specified by:
getInformationin classElement- Parameters:
deep- Whether the information should contain information about all contained elements.- Returns:
- a descriptive string which describes the resource.
- Throws:
PoolsException- If the resource cannot be located.
-
toString
public java.lang.String toString()
Returns a string representation of this resource.
-
equals
public boolean equals(java.lang.Object o)
Indicates whether some other Resource is "equal to this one.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the reference object with which to compare.- Returns:
trueif this object is the same as the o argument;falseotherwise.- See Also:
hashCode()
-
hashCode
public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided byjava.util.Hashtable.- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code value for this object.
- See Also:
equals(java.lang.Object),Hashtable
-
getElem
protected long getElem() throws PoolsExceptionReturn the pointer to this resource as an element.- Specified by:
getElemin classElement- Returns:
- The pointer to the native resource which this object wraps.
- Throws:
PoolsException- If there is an error converting the native resource pointer to a native elem pointer.
-
-