Java Reference
In-Depth Information
The CODE attribute
CODE
is a mandatory attribute used to specify the specific class that contains an
MBean implementation. In the previous simple example, the
CODE
attribute
specified
jmxbook.ch2.HelloWorld
as the MBean class for the
MLET
entry. The
classname must include the package name, and the compiled class must be con-
tained in one of the
JAR
files specified in the
ARCHIVE
attribute.
The OBJECT attribute
The
OBJECT
attribute specifies a path to a serialized object file. This attribute is
only used in place of the
CODE
attribute. The serialized object file must contain
the serialized form of an MBean to be loaded into the agent. Just like the
CODE
attribute value, the file must be contained in one of the
JAR
files listed in the
ARCHIVE
attribute. The attribute value can be a path and filename in order to
traverse a possible directory hierarchy in one of the
JAR
files.
The ARCHIVE attribute
The only other mandatory attribute is
ARCHIVE
. Its value is either a single
JAR
file
or a list of
JAR
files that contain the classes, objects, and resources needed to sup-
port a specified MBean class or serialized object file. If the value is a list of
JAR
files, the list must be enclosed in quotation marks
(")
and the filenames must be
comma separated.
The agent will assume that all specified
JAR
files are in the same directory as
the M-let file, unless the
MLET
tag contains a
CODEBASE
attribute.
The CODEBASE attribute
This attribute is used to specify a codebase
URL
value for
JAR
files listed in the
ARCHIVE
attribute. If this attribute is not specified, the
JAR
files are assumed to be
in the same directory as the M-let file.
Because the codebase is a
URL
value, you could specify any network-locatable
value. Thus an M-let file can be loaded from a remote location, and the
JAR
files
it lists can be in a different remote location. The value of this attribute should be
a fully qualified, reachable
URL
.
The NAME attribute
This attribute specifies a value for the object name for the agent to associate with
the new MBean this
MLET
entry describes. The value must have a domain and at
least one property value (see the previous
MLET
tag for a
NAME
example).