Java Dynamic Management Kit 5.1 Tutorial

15.3 Running the Discovery Example

The examplesDir/current/Discovery directory contains the source file for the application that demonstrates the discovery service.

To Run the Discovery Example
  1. Compile the Java classes.


    $ javac -classpath classpath *.java
    
  2. Start the Client.


    $ java -classpath classpath Client
    

    You will be prompted to press Enter to discover connector servers, to provide the host name of a machine where servers are running or to exit the discovery component. However, there are not yet any servers to discover, because the Responder has not yet been started.

  3. In a second terminal window, start the Monitor


    $ java -classpath classpath Monitor
    

    You will see confirmation that the monitor has started, and that it is passively listening for notifications,

  4. In a third terminal window, start the Responder.


    $ java -classpath classpath Responder
    

    You will see the creation of the different connector servers. Then you will be invited to create further connector servers by pressing Enter.

    In the window in which you started the Monitor, you will see the connector servers created by Responder being discovered.

  5. Press Enter in the terminal window in which you started the Client.

    You will see the Client discovering the connector servers created by the Responder, and connecting to them to retrieve information about them, before closing the connections.

    You can continue discovering and connecting to connector servers for as long as the Responder is active.

  6. When you have finished, stop the Responder, the Monitor and the Client.