The examplesDir/SimpleClients directory contains all of the files for three sample managers, a base agent, and some MBeans to manage. In this topic, we run the ClientWithoutProxy application which demonstrates simple operations on MBeans through an RMI connector.
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 |
We will not need all the files for this topic, but they will be used in the next topic, "MBean Proxy Objects". In this demonstration, we only need the BaseAgent and ClientWithoutProxy applications, as well as the standard and dynamic MBeans.
Launch 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 an RMI connector server to which the client application will establish a connection, and then it waits for management operations.
Wait for the agent to be completely initialized, then launch the manager with the following command:
$ java -classpath classpath ClientWithoutProxy |
The client application creates the RMI connector client and establishes the connection to 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.