Package com.sun.solaris.service.pools
Class Element
- java.lang.Object
-
- com.sun.solaris.service.pools.Element
-
- All Implemented Interfaces:
Property,PropertyWalk
- Direct Known Subclasses:
Component,Configuration,Pool,Resource
public abstract class Element extends java.lang.Object implements Property, PropertyWalk
TheElementclass represents a pools configuration element. The class is an abstract, base class for concrete implementation elements, such as pool and resource.
-
-
Field Summary
Fields Modifier and Type Field Description protected Configuration_confThe configuration to which this element belongs.
-
Constructor Summary
Constructors Constructor Description Element()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleangetBoolProperty(java.lang.String name)Get a boolean property.doublegetDoubleProperty(java.lang.String name)Get a double property.protected abstract longgetElem()Return the pointer to this subtype as an element.abstract java.lang.StringgetInformation(int deep)Returns a descriptive string which describes the element.longgetLongProperty(java.lang.String name)Get a long property.protected ValuegetProperty(java.lang.String name, long proxy)Get the property with the supplied name using the supplied proxy.java.lang.StringgetStringProperty(java.lang.String name)Get a String property.voidputProperty(java.lang.String name, Value value)Put the supplied value as an element property with the supplied name.voidrmProperty(java.lang.String name)Remove the element property with the supplied name.java.lang.StringtoString()Returns a string representation of this element.intwalk(Element elem, Value val, java.lang.Object user)Walk all properties of the invoking object.intwalkProperties(PropertyWalk handler, java.lang.Object user)Walk all the properties of this element.
-
-
-
Field Detail
-
_conf
protected Configuration _conf
The configuration to which this element belongs.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representation of this element.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this element.
-
getInformation
public abstract java.lang.String getInformation(int deep) throws PoolsExceptionReturns a descriptive string which describes the element.- Parameters:
deep- Whether the information should contain information about all contained elements.- Returns:
- a descriptive string which describes the element.
- Throws:
PoolsException- If the element cannot be located.
-
getProperty
protected Value getProperty(java.lang.String name, long proxy) throws PoolsException
Get the property with the supplied name using the supplied proxy.- Parameters:
name- The name of the property to be retrieved.proxy- The proxy item used to retrieve the property.- Returns:
- a value containing the property details.
- Throws:
PoolsException- If there is an error accessing the property.
-
putProperty
public void putProperty(java.lang.String name, Value value) throws PoolsExceptionPut the supplied value as an element property with the supplied name.- Specified by:
putPropertyin interfaceProperty- Parameters:
name- The name of the property to be updated.value- The value of the property to be updated.- Throws:
PoolsException- If there is an error accessing the property.
-
rmProperty
public void rmProperty(java.lang.String name) throws PoolsExceptionRemove the element property with the supplied name.- Specified by:
rmPropertyin interfaceProperty- Parameters:
name- The name of the property to be removed.- Throws:
PoolsException- If there is an error removing the property.
-
getStringProperty
public java.lang.String getStringProperty(java.lang.String name) throws PoolsExceptionGet a String property. If the type of the property does not match, i.e. it's not a String, or the element does not have such a property then a PoolsException is thrown.- Specified by:
getStringPropertyin interfaceProperty- Parameters:
name- The name of the property to be retrieved.- Throws:
PoolsException- If getting the String property fails.
-
getLongProperty
public long getLongProperty(java.lang.String name) throws PoolsExceptionGet a long property. If the type of the property does not match, i.e. it's not a long, or the element does not have such a property then a PoolsException is thrown.- Specified by:
getLongPropertyin interfaceProperty- Parameters:
name- The name of the property to be retrieved.- Throws:
PoolsException- If getting the long property fails.
-
getDoubleProperty
public double getDoubleProperty(java.lang.String name) throws PoolsExceptionGet a double property. If the type of the property does not match, i.e. it's not a double, or the element does not have such a property then a PoolsException is thrown.- Specified by:
getDoublePropertyin interfaceProperty- Parameters:
name- The name of the property to be retrieved.- Throws:
PoolsException- If getting the double property fails.
-
getBoolProperty
public boolean getBoolProperty(java.lang.String name) throws PoolsExceptionGet a boolean property. If the type of the property does not match, i.e. it's not a boolean, or the element does not have such a property then a PoolsException is thrown.- Specified by:
getBoolPropertyin interfaceProperty- Parameters:
name- The name of the property to be retrieved.- Throws:
PoolsException- If getting the boolean property fails.
-
walk
public int walk(Element elem, Value val, java.lang.Object user) throws PoolsException
Walk all properties of the invoking object.- Specified by:
walkin interfacePropertyWalk- Parameters:
elem- The element to whom the property belongs.val- The value representing the current element.user- User supplied data, provided when the walk is invoked.- Returns:
- 0 to continue the walk, anything else to terminate it.
- Throws:
PoolsException- If there is an error walking the property.
-
getElem
protected abstract long getElem() throws PoolsExceptionReturn the pointer to this subtype as an element.- Returns:
- The pointer to the native subtype which this object wraps.
- Throws:
PoolsException- If there is an error converting the native subtype pointer to a native elem pointer.
-
walkProperties
public int walkProperties(PropertyWalk handler, java.lang.Object user) throws PoolsException
Walk all the properties of this element.- Parameters:
handler- The object which will receive the callbacks.user- Data supplied by the user for use in the callback.- Returns:
- 0 for a successful walk, else 1.
- Throws:
PoolsException- If there is an error during the walk.
-
-