Java Dynamic Management Kit 5.0 Tutorial

Running the Generic Proxy Example

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

To Run the Generic 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

    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.

  2. If it is not already running on your host, 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.

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

    $ java -classpath classpath ClientGenericProxy
  4. 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.

  5. Press Enter in both windows to exit the base agent and manager applications.