站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 jmx API Documentation 英文版文档

DescriptorSupport (JBoss/JMX API) - JBoss 3.2.7 jmx API Documentation 英文版文档


javax.management.modelmbean
Class DescriptorSupport

java.lang.Object
  extended byjavax.management.modelmbean.DescriptorSupport
All Implemented Interfaces:
Cloneable, Descriptor, Serializable

public class DescriptorSupport
extends Object
implements Descriptor, Cloneable, Serializable

Support class for creating descriptors.

Version:
$Revision: 1.6.4.6 $

Revisions:

20020320 Juha Lindfors:

  • toString() implementation

20020525 Juha Lindfors:

  • public currClass field removed to match JMX 1.1 MR

20020715 Adrian Brock:

  • Serialization
Author:
Juha Lindfors., Adrian Brock.
See Also:
Descriptor, Serialized Form

Constructor Summary
DescriptorSupport()
          Default constructor.
DescriptorSupport(DescriptorSupport descriptor)
          Copy constructor.
DescriptorSupport(int initialSize)
          Creates descriptor instance with a given initial size.
DescriptorSupport(String xmlString)
           
DescriptorSupport(String[] fields)
           
DescriptorSupport(String[] fieldNames, Object[] fieldValues)
          Creates descriptor instance with given field names and values.if both field names and field values array contain empty arrays, an empty descriptor is created.
 
Method Summary
 Object clone()
          Returns a descriptor that is a duplicate of this one.
 String[] getFieldNames()
          Retrieves all the field names in this descriptor.
 String[] getFields()
          Retrieves all the fields in this descriptor.
 Object getFieldValue(String inFieldName)
          Retrieves the value of a field.
 Object[] getFieldValues(String[] fieldNames)
          Retrieves all the field values for the passed field names.
 boolean isValid()
          Checks to see that this descriptor is valid.
 void removeField(String fieldName)
          Remove a field from the descriptor.
 void setField(String inFieldName, Object fieldValue)
          Sets the value of a field.
 void setFields(String[] fieldNames, Object[] fieldValues)
          Set multiple fields in this descriptor.
 String toString()
           
 String toXMLString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DescriptorSupport

public DescriptorSupport()
Default constructor.


DescriptorSupport

public DescriptorSupport(int initialSize)
                  throws MBeanException
Creates descriptor instance with a given initial size.

Parameters:
initialSize - initial size of the descriptor
Throws:
MBeanException - this exception is never thrown but is declared here for Sun RI API compatibility
RuntimeOperationsException - if the initialSize is zero or negative. The target exception wrapped by this exception is an instace of IllegalArgumentException class.

DescriptorSupport

public DescriptorSupport(DescriptorSupport descriptor)
Copy constructor.

Parameters:
descriptor - the descriptor to be copied
Throws:
RuntimeOperationsException - if descriptor is null. The target exception wrapped by this exception is an instance of IllegalArgumentException class.

DescriptorSupport

public DescriptorSupport(String[] fieldNames,
                         Object[] fieldValues)
                  throws RuntimeOperationsException
Creates descriptor instance with given field names and values.if both field names and field values array contain empty arrays, an empty descriptor is created. None of the name entries in the field names array can be a null reference. Field values may contain null references.

Parameters:
fieldNames - Contains names for the descriptor fields. This array cannot contain null references. If both fieldNames and fieldValues arguments contain null or empty array references then an empty descriptor is created. The size of the fieldNames array must match the size of the fieldValues array.
fieldValues - Contains values for the descriptor fields. Null references are allowed.
Throws:
RuntimeOperationsException - if array sizes don't match

DescriptorSupport

public DescriptorSupport(String[] fields)

DescriptorSupport

public DescriptorSupport(String xmlString)
                  throws MBeanException,
                         RuntimeOperationsException,
                         XMLParseException
Method Detail

getFieldValue

public Object getFieldValue(String inFieldName)
Description copied from interface: Descriptor
Retrieves the value of a field.

Specified by:
getFieldValue in interface Descriptor
Parameters:
inFieldName - the name of the field.
Returns:
the value of the field.

setField

public void setField(String inFieldName,
                     Object fieldValue)
Description copied from interface: Descriptor
Sets the value of a field.

Specified by:
setField in interface Descriptor
Parameters:
inFieldName - the name of the field.
fieldValue - the value of the field.

getFields

public String[] getFields()
Description copied from interface: Descriptor
Retrieves all the fields in this descriptor. The format is fieldName=fieldValue for String values and fieldName=(fieldValue.toString()) for other value types.

Specified by:
getFields in interface Descriptor
Returns:
an array of fieldName=fieldValue strings.

getFieldNames

public String[] getFieldNames()
Description copied from interface: Descriptor
Retrieves all the field names in this descriptor.

Specified by:
getFieldNames in interface Descriptor
Returns:
an array of field name strings.

getFieldValues

public Object[] getFieldValues(String[] fieldNames)
Description copied from interface: Descriptor
Retrieves all the field values for the passed field names. The array of object values returned is in the same order as the field names passed to the method.

When a fieldName does not exist, the corresponding element of the returned array is null.

Specified by:
getFieldValues in interface Descriptor
Parameters:
fieldNames - the array of field names to retrieve. Pass null to retrieve all fields.
Returns:
an array of field values.

setFields

public void setFields(String[] fieldNames,
                      Object[] fieldValues)
Description copied from interface: Descriptor
Set multiple fields in this descriptor. The field in the fieldNames array is set to the value of the corresponding fieldValues array. The two arrays must be the same size.

Specified by:
setFields in interface Descriptor
Parameters:
fieldNames - an array of fieldNames to set. Neither the array or array elements can be null. The fieldName must exist.
fieldValues - an array of fieldValues to set. Neither the array or array elements can be null. The fieldValue must be valid for the corresponding fieldName.

clone

public Object clone()
Description copied from interface: Descriptor
Returns a descriptor that is a duplicate of this one.

Specified by:
clone in interface Descriptor

removeField

public void removeField(String fieldName)
Description copied from interface: Descriptor
Remove a field from the descriptor.

Specified by:
removeField in interface Descriptor
Parameters:
fieldName - the field to remove. No exception is thrown when the field is not in the descriptor.

isValid

public boolean isValid()
                throws RuntimeOperationsException
Description copied from interface: Descriptor
Checks to see that this descriptor is valid.

Specified by:
isValid in interface Descriptor
Returns:
true when the fieldValues are legal for the fieldNames, false otherwise.
Throws:
RuntimeOperationsException - for any error performing the validation.

toXMLString

public String toXMLString()
                   throws RuntimeOperationsException
Throws:
RuntimeOperationsException

toString

public String toString()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.