Java Reference
In-Depth Information
Figure 10.2
JMX agent creating MBeans by loading an M-let file
The contents of an M-let file closely resemble XML. If you have XML experi-
ence, you will recognize the content structure; if you don't, it will still be easy
to understand.
The following is a simple entry from an M-let file. It does not contain all the
possible attributes, but it shows the
MLET
tag used to encapsulate an entire entry
in an M-let file:
<MLET CODE=jmxbook.ch2.HelloWorld ARCHIVE=test.jar
NAME=hello:type=HelloWorld>
</MLET>
This
MLET
entry tells the agent to load the test.jar file, look for the
jmxbook.
ch2.HelloWorld
class, and create and register a
HelloWorld
MBean with an object
name of
hello:type=HelloWorld
.
As you can see, the
MLET
tag contains attributes that specify a classname, a
location for the class, and an object name for a new MBean to be created. Every
M-let file can contain any number of
MLET
entries. Before going any further, let's
examine each
MLET
tag attribute in the following sections.