Java Dynamic Management Kit 5.1 Tutorial

9.3.1 RMI Connector Server Example

The RMI connector server example is found in the examplesDir/current/Connectors/rmi directory.

To Run the RMI Connector Server Example
  1. Compile the Java classes.


    $ javac -classpath classpath *.java 
  2. Start an RMI registry on port 9999 of the local host.


    $ export CLASSPATH=.:classpath ; rmiregistry 9999 &
  3. Start the RMI connector server:


    $ java -classpath .:classpath Server &

    You will see confirmation of the creation of the MBean server and the RMI connector server.

  4. Start the RMI connector client:


    $ java -classpath .:classpath Client

    You will see confirmation of the creation of the RMI connector client and of the connection with the connector server. You will also be informed of the domain name, and the creation and registration of SimpleStandard MBean. The client will then perform operations on SimpleStandard MBean, before unregistering it.