Java Reference
In-Depth Information
■
java.lang.Void
■
java.lang.Boolean
■
java.lang.Byte
■
java.lang.Character
■
java.lang.String
■
java.lang.Short
■
java.lang.Integer
■
java.lang.Long
■
java.lang.Float
■
java.lang.Double
■
javax.management.ObjectName
■
javax.management.openmbean.CompositeData
■
javax.management.openmbean.TabularData
You could expect all these classes to be present in a management environment. All
the primitive wrapper classes are present in all Java virtual machines. And, the
ObjectName
class and
openmbean
package would be present in all
JMX
-compliant
environments.
The three new data types need some explanation. The
CompositeData
and
TabularData
types are both Java interfaces used to define more complex data
structures. Objects that implement these interfaces create aggregates of the
other basic data types. These values can also be used in arrays. The next section
discusses the
CompositeData
and
TabularData
interfaces in more detail.
A.3 Creating more complex data structures
MBeans that could only operate using primitive data types would quickly run out
of options when trying to model and manage complex resources. To help rem-
edy this problem and maintain an open, flexible MBean, the Open MBean uses
the
CompositeData
and
TabularData
interfaces to compose more complex data
structures. Objects of these types create aggregate structures made up of the
other basic data types, including themselves. This means that management
applications can interact with data sets of any structure from Open MBeans. In
addition, both
CompositeData
and
TabularData
types are created with descriptors
that contain detailed information about the data they contain.
A.3.1
The CompositeData interface
Yo u c a n t h i n k o f a
CompositeData
object as a hashtable-like object that stores key-
value pairs.
CompositeData
values contain a
String
key that corresponds to an