Java Dynamic Management Kit 4.2 Tutorial

Running the Generic Proxy Example

The ClientGenericProxy application, also in the examplesDir/SimpleClients directory, demonstrates the use of generic proxies.

If you haven't done so already, compile all files in this directory with the javac command. For example, on the Solaris platform with the Korn shell, you would type:


$ cd examplesDir/SimpleClients/
$ javac -classpath classpath *.java

Because generic proxies do not need to be generated, this example does not need the proxygen tool. The GenericProxy class is available in the usual classpath for the product's runtime libraries.

Instructions
  1. If it is not already running on your host, launch the base agent in a terminal window with the following command:


    $ java -classpath classpath BaseAgent
    

    The agent creates the RMI connector server to which the client application will establish a connection, and then it waits for management operations.

  2. Wait for the agent to be completely initialized, then launch the management application in another window on the same host:


    $ java -classpath classpath ClientGenericProxy
    
  3. Press <Enter> in the manager window to step through the example.

    As seen in the code examples, the client application instantiates generic proxy objects to access both a standard and dynamic MBean that it creates in the base agent. The only difference between the two is the user-provided information available in the dynamic MBean's metadata.

  4. Press <Enter> in both windows to exit the base agent and manager applications.