Sample J4ONet Server

    This section will take you through the startup, configuration, and use of a J4ONet installation. It will use the XML files that were generated with the settings in the jmx4odp/src/conf/basic_build.properties file. The sample can be run on one or across two computers.

    In the jmx4odp/bin directory, run the start_agent shell/batch script. This will start a JMX agent running the Sun JMX RI HTML adaptor and RMI connector. If you haven't changed the default ports, then you can open a web browser to http://localhost:7000 to access the agent.

    If you have JMX4ODP installed on a second machine, run the start_agent script there too. Now you have two agents running on two machines. If you just start it on one machine, the sample will still run, but you won't get to see the broadcast resolver in action.

    Once you have the agents running, run the init_local shell/batch script. This script executes org.jmx4odp.j4oNet.XmlExecutor object, which reads an XML file that contains information for executing on a remote JMX agent. In this case, the LocalJ4oStartup.xml contains instructions for starting the J4ONet system on a JMX agent.

    If you have a second agent running, then run the init_partner shell/batch script. You can run this on any computer. In will initialize the J4ONet system on the partner computer defined by the jmx4odp/src/conf/basic_build.properties file.

    By this point, if everything has gone right, you are running the J4ONet network. Open a web browser to http://localhost:7000. Now click on the "Admin" button. You will now be at the web form that allows you register new MBeans. Enter the following parameters:

    Domain: Test
    Keys:name=testbean
    Java Class:org.jmx4odp.j4oNet.TestExample

    You can ignore the ClassLoader field. Now send the request. This will create an instance of the TestExample on this agent. You should see a "Create Successful" message. Now click on the "Back to Agent View" link. Now locate the Test:name=testbean mbean in the directory and click on in it.

    This MBean has one function that you can call, findMBeanByClass. As the name implies, it takes the name of a java class and will use J4ONet to locate any MBeans on the network match the class. Try using the class:

    org.jmx4odp.j4oNet.J4ONet

    TestExample will locate the JsRegistry, which will utilize any MBeanResolvers registered to locate matching MBeans. If there is another server running J4ONet, then the results will include the J4OnetMBeans running on these servers too.