Java Reference
In-Depth Information
to provide some measure of assistance to management users. The description
should provide meaningful information such as the possible values of an attribute
or the effect of an operation.
The following sections provide more detail about each of the support classes
that implement the interfaces listed in table A.1.
A.5.1
The OpenMBeanInfoSupport class
The
OpenMBeanInfoSupport
class implements the
OpenMBeanInfo
interface and
extends the
MBeanInfo
class. Toward this end, it inherits the name and descrip-
tion methods used to describe the overall MBean.
The support class overrides the methods that return arrays of metadata objects
for attributes, operations, and constructors. It does so in order to return the
appropriate Open MBean metadata objects instead of the usual metadata. Open
MBeans use the normal
MBeanNotificationInfo
object to describe notifications,
so no new implementation is provided in the support class.
A.5.2
The OpenMBeanOperationSupport and
OpenMBeanConstructorSupport classes
These two subclasses represent operations and constructors, respectively. Both
classes override the
getSignature()
method in order to provide the correct Open
MBean metadata return type.
The
OpenMBeanOperationSupport
class adds an additional method,
getReturn-
OpenType()
, which returns the open type descriptor object that describes the object
being returned from an operation. In addition, the
getImpact()
method of the
OpenMBeanOperationSupport
class must return anything except
UNKNOWN
(see the
MBeanOperationInfo
class in chapter 5 for more details).
A.5.3
The OpenMBeanAttributeSupport and
OpenMBeanParameterSupport classes
Like the
OpenMBeanOperationSupport
class, both the
OpenMBeanAttributeSupport
and
OpenMBeanParameterSupport
classes provide a new method,
getOpenType()
,
which is used to describe the type of parameter or attribute they represent. The
return type of the
getOpenType()
method is one of the four open-type classes pre-
viously described.
In addition, both classes implement the
getDefaultValue()
and
getLegalVal-
ues()
methods. The
getDefaultValue()
method returns a value that is applicable
to the type returned by the
getType()
method of each class. The
getLegalVal-
ues()
method returns an array of objects that must be compatible with the type