Java Dynamic Management Kit 4.1 Tools Reference

The proxygen Compiler

A proxy MBean is generated from its corresponding MBean by using the proxygen compiler supplied with the Java Dynamic Management Kit. A proxy MBean is an image of an agent-side MBean and exists on the manager side. The proxygen tool allows you to customize your proxy MBeans depending on how you want to use them in your management application. For more information regarding the relationship between MBeans and proxy MBeans, refer to Getting Started with the Java Dynamic Management Kit 4.1, which is part of this product documentation set.

The proxygen compiler takes the compiled Java class of an MBean and generates the Java interface and Java proxies of a MBean. The Java proxies consist of Java source code that implements the interface. To develop a Java manager with code generated by proxygen, you call the methods of the proxy MBean's interface.

Options of the proxygen compiler enable you to modify the characteristics of the proxies you generate from an MBean. For example, options are available that enable you to generate read-only or read-write proxies. By generating from the same MBean a set of proxies with different characteristics, you can develop a Java manager whose behavior is modified at runtime, depending on which proxies are loaded. For example, when the read-only proxies are loaded, the Java manager will not be able to modify properties in the MBean.

A proxy MBean consists of two components:

For example, if you have an MBean MyClass, the proxygen compiler gives you a proxy MBean that consists of the following files:

The proxygen compiler generates Java source code, not compiled Java classes. For your proxy MBeans to be accessible to a Java manager, you have to compile the files that proxygen generates, and make sure that the compiled Java classes are stored at the location specified by the CLASSPATH environment variable of the manager, or accessible through the class loader of the manager.