Java Dynamic Management Kit 5.0 Tutorial

Running the Standard Proxy Example

The examplesDir/SimpleClients directory contains all of the files for the ClientMBeanProxy application that demonstrates the use of standard MBean proxies.

To Run the Standard Proxy Example
  1. Compile all files in this directory with the javac command, if you have not done so already.

    For example, on the Solaris platform with the Korn shell, type:

    $ cd examplesDir/SimpleClients/
    $ javac -classpath classpath *.java
  2. Generate the proxy MBeans classes and compile them. To do this, from the same directory as above, type the following commands:

    $ installDir/SUNWjdmk/jdmk5.0/proxygen SimpleStandard
    $ javac -classpath classpath
  3. Start 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.

  4. Wait for the agent to be completely initialized, then, in another window on the same host, start the management application with the following command:

    $ java -classpath classpath ClientMBeanProxy
  5. Press Enter in the manager window to step through the example.

    As seen in the code examples, the client application instantiates the proxy objects to access the MBean it has created in the base agent.

  6. Press Enter one last time to exit the manager application, but leave the base agent running for the next example.