|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--javax.management.modelmbean.DescriptorSupport
This class represents the metadata set for a ModelMBean element. A descriptor is part of the ModelMBeanInfo, ModelMBeanNotificationInfo, ModelMBeanAttributeInfo, ModelMBeanConstructorInfo, and ModelMBeanParameterInfo.
A descriptor consists of a collection of fields. Each field is in fieldname=fieldvalue format. Field names are not case sensitive, case will be preserved on field values.
All field names and values are not predefined. New fields can be defined and added by any program. Some fields have been predefined for consistency of implementation and support by the ModelMBeanInfo, ModelMBeanAttributeInfo, ModelMBeanConstructorInfo, ModelMBeanNotificationInfo, ModelMBeanOperationInfo and ModelMBean classes.
| Field Summary | |
(package private) static java.lang.String |
CLASS
|
(package private) static java.lang.String |
CURRENCY_TIME_LIMIT
|
(package private) static java.lang.String |
DEFAULT
|
(package private) java.util.HashMap |
descriptor
|
(package private) static java.lang.String |
DESCRIPTOR_TYPE
|
(package private) static java.lang.String |
DISPLAY_NAME
|
(package private) static java.lang.String |
GET_METHOD
|
(package private) static java.lang.String |
ITERABLE
|
(package private) static java.lang.String |
LAST_RETURNED_VALUE
|
(package private) static java.lang.String |
LAST_UPDATED_TIMESTAMP
|
(package private) static java.lang.String |
LOG
|
(package private) static java.lang.String |
LOG_FILE
|
(package private) static java.lang.String |
MESSAGE_ID
|
(package private) static java.lang.String |
MESSAGE_TEXT
|
(package private) static java.lang.String |
NAME
|
(package private) static java.lang.String |
PERSIST_PERIOD
|
(package private) static java.lang.String |
PERSIST_POLICY
|
(package private) static java.lang.String |
PRESENTATION_STRING
|
(package private) static java.lang.String |
PROTOCOL_MAP
|
(package private) static java.lang.String |
ROLE
|
(package private) static java.lang.String |
SET_METHOD
|
(package private) static java.lang.String |
SEVERITY
|
(package private) static java.lang.String |
TARGET_OBJECT
|
(package private) static java.lang.String |
TARGET_TYPE
|
(package private) static java.lang.String |
UNKNOWN
|
(package private) static java.lang.String |
VALUE
|
(package private) static java.lang.String |
VISIBILITY
|
| Constructor Summary | |
DescriptorSupport()
Descriptor default constructor. |
|
DescriptorSupport(DescriptorSupport inDescr)
Descriptor constructor taking a Descriptor as parameter. |
|
DescriptorSupport(int initNumFields)
Descriptor constructor. |
|
DescriptorSupport(java.lang.String inStr)
Descriptor constructor taking an XML String. |
|
DescriptorSupport(java.lang.String[] fields)
Constructor taking fields in the fieldName=fieldValue format. |
|
DescriptorSupport(java.lang.String[] fieldNames,
java.lang.Object[] fieldValues)
Constructor taking field names and field values. |
|
| Method Summary | |
(package private) static void |
|
java.lang.Object |
clone()
Returns a new Descriptor which is a duplicate of the Descriptor. |
java.lang.String[] |
getFieldNames()
Returns all the fields names in the descriptor. |
java.lang.String[] |
getFields()
Returns all the fields in the descriptor. |
java.lang.Object |
getFieldValue(java.lang.String inFieldName)
Returns the value for a specific fieldname. |
java.lang.Object[] |
getFieldValues(java.lang.String[] fieldNames)
Returns all the field values in the descriptor as an array of Objects. |
boolean |
isValid()
Returns true if all of the fields have legal values given their names. |
void |
removeField(java.lang.String fieldName)
Removes a field from the descriptor. |
void |
setField(java.lang.String inFieldName,
java.lang.Object fieldValue)
Sets the string value for a specific fieldname. |
void |
setFields(java.lang.String[] fieldNames,
java.lang.Object[] fieldValues)
Sets all Fields in the list to the new value in with the same index in the fieldValue array. |
java.lang.String |
toString()
Returns |
java.lang.String |
toXMLString()
Returns an XML String representing the descriptor. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
java.util.HashMap descriptor
static java.lang.String NAME
static java.lang.String DESCRIPTOR_TYPE
static java.lang.String VALUE
static java.lang.String DEFAULT
static java.lang.String DISPLAY_NAME
static java.lang.String GET_METHOD
static java.lang.String SET_METHOD
static java.lang.String PROTOCOL_MAP
static java.lang.String PERSIST_POLICY
static java.lang.String PERSIST_PERIOD
static java.lang.String CURRENCY_TIME_LIMIT
static java.lang.String LAST_UPDATED_TIMESTAMP
static java.lang.String ITERABLE
static java.lang.String VISIBILITY
static java.lang.String PRESENTATION_STRING
static java.lang.String UNKNOWN
static java.lang.String ROLE
static java.lang.String CLASS
static java.lang.String SEVERITY
static java.lang.String MESSAGE_ID
static java.lang.String MESSAGE_TEXT
static java.lang.String LOG
static java.lang.String LOG_FILE
static java.lang.String TARGET_OBJECT
static java.lang.String TARGET_TYPE
static java.lang.String LAST_RETURNED_VALUE
| Constructor Detail |
public DescriptorSupport()
isValid returns false)
public DescriptorSupport(int initNumFields)
throws MBeanException,
RuntimeOperationsException
isValid returns false)initNumFields - The initial capacity of the Map that stores the descriptor fields.public DescriptorSupport(DescriptorSupport inDescr)
inDescr - the descriptor to be used to initialize the constructed descriptor. If it is
null or contains no descriptor fields, an empty Descriptor will be created.
public DescriptorSupport(java.lang.String inStr)
throws MBeanException,
RuntimeOperationsException,
XMLParseException
Descriptor constructor taking an XML String.
The format of the XML string is not defined, but an
implementation must ensure that the string returned by
toXMLString() on an existing
descriptor can be used to instantiate an equivalent
descriptor using this constructor.
In this implementation, all field values will be created as Strings. If the field values are not Strings, the programmer will have to reset or convert these fields correctly.
inStr - An XML-formatted string used to populate this
Descriptor. The format is not defined, but any
implementation must ensure that the string returned by
method toXMLString on an existing
descriptor can be used to instantiate an equivalent
descriptor when instantiated using this constructor.
public DescriptorSupport(java.lang.String[] fieldNames,
java.lang.Object[] fieldValues)
throws RuntimeOperationsException
fieldNames - String array of field names. No elements of this array can be null.fieldValues - Object array of the corresponding field values.
Elements of the array can be null. The fieldValue must be valid for the fieldName (as defined in method isValid)
Note: array sizes of parameters should match. If both arrays are null or empty, then
an empty descriptor is created.public DescriptorSupport(java.lang.String[] fields)
fields - String array of with each element containing a field name and value.
If this array is null or empty, then the default constructor will be executed. Null strings
or empty strings will be ignored.
All fields values should be Strings. If the field values are not
Strings, the programmer will have to reset or convert these fields correctly.
Note: Each string should be of the form fieldName=fieldValue.| Method Detail |
static void()
public java.lang.Object getFieldValue(java.lang.String inFieldName)
throws RuntimeOperationsException
inFieldName - The field name in question; if not found,
null is returned.
public void setField(java.lang.String inFieldName,
java.lang.Object fieldValue)
throws RuntimeOperationsException
isValid). If the field does not exist, it is
added at the end of the Descriptor. If it does exist, the
value is replaced.inFieldName - The field name to be set. Must
not be null or empty string.fieldValue - The field value to be set for the field
name. Can be null.public java.lang.String[] getFields()
setFields(java.lang.String[], java.lang.Object[])public java.lang.String[] getFieldNames()
public java.lang.Object[] getFieldValues(java.lang.String[] fieldNames)
fieldNames - String array of the names of the fields that the values
should be returned for.
public void setFields(java.lang.String[] fieldNames,
java.lang.Object[] fieldValues)
throws RuntimeOperationsException
isValid)
If it is not valid, then an exception will be thrown.
If the arrays are empty, then no change will take effect.fieldNames - String array of field names. The array and array elements cannot be null.fieldValues - Object array of the corresponding field values. The array cannot be null.
Elements of the array can be null.getFields()
public java.lang.Object clone()
throws RuntimeOperationsException
public void removeField(java.lang.String fieldName)
fieldName - String name of the field to be removed.
If the field is not found no exception is thrown.
public boolean isValid()
throws RuntimeOperationsException
This implementation does not support interopreating with a directory or lookup service. Thus, conforming to the specification, no checking is done on the "export" field.
Otherwise this implementation returns false if:
public java.lang.String toXMLString()
Returns an XML String representing the descriptor.
The format is not defined, but an implementation must
ensure that the string returned by this method can be
used to build an equivalent descriptor when instantiated
using the constructor DescriptorSupport(String inStr).
Fields which are not String objects will have toString() called on them to create the value. The value will be enclosed in parentheses. It is not guaranteed that you can reconstruct these objects unless they have been specifically set up to support toString() in a meaningful format and have a matching constructor that accepts a String in the same format.
If the descriptor is empty the following String is returned: <Descriptor></Descriptor>
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||