Generating proxy objects for your MBeans is an optional step which depends upon the design of your management application. As discussed earlier in this guide, a proxy object that represents an MBean in a remote agent. The manager accesses an MBean by performing operations on the proxy MBean.
Proxy objects simplify the design of your management application because the provide an abstraction of remote resources. Your architecture can assume that resources are local because they appear to be, even if they are not. Of course, proxies have greater response times than local resources, but the difference is usually negligible.
Using proxies also simplifies the code of your application. Through the connector client, the proxy object handles all communication details. Your code invokes a method which returns a value; the complete mechanism of performing the remote management request is hidden. This object oriented design of having a local object represent a remote resource is fully in the spirit of the Java programming language.
Assuming a management application has already established the connection to an agent, the overhead of a proxy object is minimal, both in terms of resource usage and required setup. However, it is common sense to instantiate proxies only for resources that will be accessed often or which are long-lived.
The development cost of a proxy MBean is also minimal. Standard proxies are fully generated from their corresponding MBean by using the proxygen compiler supplied with the Java Dynamic Management Kit. Generic proxies are part of the Java Dynamic Management runtime libraries and just need to be instantiated.
Options of the proxygen tool allow you to modify the characteristics of the proxies you generate from an MBean. For example, the read-only option will generate proxies whose setter methods return exceptions. By generating sets of proxies with different characteristics from the same MBean, you can develop a Java manager whose behavior is modified at runtime, depending on which set is available.
In an advanced management solution where resources are discovered only at runtime, the proxy class could be loaded dynamically in the manager. For example, the resource might expose an attribute called ProxyURL from which a class loader can retrieve the proxy object.