![]() |
JMX Reference Implementation Tutorial |
![]() Agent Administration |
![]() Contents |
![]() Standard and Dynamic MBeans |
Sometimes, launching an MBean requires several steps: this is particularly the case for agent services which require some sort of configuration. For example, you can instantiate another HTML adaptor for connecting to a different port.Action: On the agent administration page, fill in the fields as follows:
Domain: Adaptor Keys : name=html,port=8088 Java Class: com.sun.jdmk.comm.HtmlAdaptorServerMake sure the selected action is "Create" and send the request. If you scroll down the admin page, you should see if your request was successful. You can't connect to this HTML adaptor quite yet, we need to configure it first.
Action: Go to the new HTML adaptor's MBean view with the provided link.
We couldn't modify any of the attributes before because the implementation is designed so that they can't be modified while it is running. Our new HTML adaptor is instatiated in the stopped state (the "StateString" attribute indicates "OFFLINE"), so we can change its attributes.
Action: Set the "Port" attribute to "8088" and "MaxActiveClientCount" to "2", then click the "Apply" button. If the page is reloaded and the new values are displayed, the attribute write operation was successful. You may also click the attribute names to get an explanation for them.
Action: Now scroll down the MBean view to the "Start" operation and click its button. This brings up a new page to tell us the operation was successful. If you go back to the MBean view with the provided link, you can see that the "StateString" is now indicating "ONLINE".
Now you should be able to access your base agent through a browser on port 8088. Try going to a different machine on the same network and connecting to the URL:
http://agentHostName:8088/ (where agentHostName is the name or IP address of the machine where you launched the BaseAgent). If you reload the MBean view of the new HTML adaptor, you should see the name of this other machine as the value of the "LastConnectedClient" attribute.
Through this other connection, you could stop, modify or remove the HTML adaptor MBean using port 8082. In that case, your original browser will have to use (or http://localhost:8088/) as well to connect.
Leave an agent view open on another machine for the next topic.
![]() Agent Administration |
![]() Contents |
![]() Standard and Dynamic MBeans |
Copyright © 2000
Sun Microsystems, Inc.,
901 San Antonio Road, Palo Alto, CA 94303, USA.
All rights reserved.