The examplesDir/legacy/SimpleClients directory contains all of the files for three sample managers, a base agent, and some MBeans to manage. In this chapter, we run the ClientWithoutProxy application that demonstrates simple operations on MBeans through a legacy RMI connector.
Compile all files in this directory with the javac command.
For example, on the Solaris platform with the Korn shell, type:
$ cd examplesDir/legacy/SimpleClients/ $ javac -classpath classpath *.java
We do not need all the files for this chapter, but they are used in Chapter 24, Legacy Proxy Mechanism. In this demonstration, we only need the BaseAgent and ClientWithoutProxy applications, as well as the standard and dynamic MBeans.
Start the agent in another terminal window on the same host with the following command:
$ java -classpath classpath BaseAgent
The agent creates an HTML protocol adaptor and a legacy RMI connector server to which the client application establishes a connection, and then it waits for management operations.
Wait for the agent to be completely initialized, then start the manager with the following command:
$ java -classpath classpath ClientWithoutProxy
The client application creates the RMI connector client and establishes the connection to the base agent.
Press Enter in the manager window to step through the example.
The management application instantiates both types of MBeans, looks at their metadata, and performs management operations on them. The results of each step are displayed in the terminal window.
At any time, you can view the agent through its HTML adaptor and interact with the MBeans created by the management application.
For example, immediately after the manager creates an MBean, you could modify its attributes and see this change reflected when the connector client access the new values.
Press Enter in both windows to stop the agent and manager applications.