The connector server examples demonstrate the following:
The server:
Creates an MBean server
Creates an RMI or a JMXMP connector server
The remote client:
Creates an RMI or a JMXMP connector
Creates a simple standard MBean in the MBean server, via the RMI connection
Creates a generic notification listener.
Basic operations are performed on the MBean registered in the MBean server, via the RMI connection
The RMI connector server example is found in the examplesDir/current/Connectors/rmi directory.
Compile the Java classes.
$ javac -classpath classpath *.java |
Start an RMI registry on port 9999 of the local host.
$ export CLASSPATH=.:classpath ; rmiregistry 9999 & |
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.
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.
The JMXMP connector server example is found in the examplesDir/current/Connectors/jmxmp directory.
Compile the Java classes.
$ javac -classpath classpath *.java |
Start the JMXMP connector server:
$ java -classpath .:classpath Server & |
You will see confirmation of the creation of the MBean server and the JMXMP connector server.
Start the JMXMP 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.