Java Reference
In-Depth Information
As mentioned in the chapter introduction, JMX agents have the ability to load
remote class files and create MBeans. This agent service lets an agent use classes
that are not in its original startup CLASSPATH .
First, you place the new MBean class files in a downloadable location; then you
use the M-let loading service to access them. Now the agent can instantiate the
new MBeans without being restarted. In addition, the dynamic loading service
provides a mechanism to add to the agent's codebase at runtime, allowing you to
make classes available without necessarily creating MBeans at the same time.
The next section starts the discussion of the JMX M-let service. This agent
service provides the mechanism to dynamically load classes into the agent.
10.2 Using the M-let service
You will notice that all the agent services provided in this and the next chapter
are also MBeans. This is the case so that the services can be instantiated and con-
figured as needed. The M-let agent service handles the dynamic loading of
MBeans; it must reside in every JMX agent compliant with the JMX specification.
To load new MBeans, users point the service to a remote M-let text file. An M-
let text file is an XML-like file that contains information about loading classes
and creating MBeans. The M-let service loads this file, processes the information
it contains, and downloads the named classes in order to create one or more
MBeans. Figure 10.2 illustrates how the M-let service works.
Remember, because the M-let service is also a registered MBean in the agent,
it can be used by the agent itself, other MBeans, or remote management applica-
tions. The M-let service lets you load MBean classes and their resources from
remote locations by using M-let files; it also acts as a class loader, providing the
ability to expand an agent's codebase.
Before we discuss the M-let service MBean, let's examine the contents of an
M-let file.
10.2.1
Writing M-let files
This section will walk you through the possible contents of an M-let file. After
we cover this topic and the M-let MBean class, you will begin writing some con-
crete examples.
The M-let service finds M-let files by being provided a URL to the file. So,
there are no restrictions on the name of an M-let file.
Search WWH ::




Custom Search