Getting Started with the Java Dynamic Management Kit 4.2

Dynamic Loading

Dynamic class loading is performed by loading management applets or m-lets containing MBeans. This service will load classes from an arbitrary network location and create the MBeans that they represent. The m-let service is defined by the JMX specification and makes it possible to create dynamically extensible agents.

A management applet is an HTML-like tag called <MLET> which specifies information about the MBeans to be loaded. It resembles the <APPLET> tag except that it will only load MBean classes. The tag contains information for downloading the class, such as the classname and the location of its class file. You may also specify any arguments to the constructor used to instantiate the MBean.

The m-let service loads a URL which identifies the file containing <MLET> tags, one for each MBean to be instantiated. The service uses a class loader to load the class files into the application's Java virtual machine. It then instantiates these classes and registers them as MBeans in the MBean server.

The m-let service is implemented as an MBean and instantiated and registered in the MBean server. Thus, it can be used either by other MBeans or by management applications. For example, a application could make new MBean classes available at some location, generate the m-let file and instruct the m-let service in an agent to load the new MBeans.

Dynamic loading effectively pushes new functionality into agents, allowing management applications to deploy upgrades and implement new resources in their agents.