Java Dynamic Management Kit 4.0 Tools Reference

Chapter 3 HTML Adaptor

An adaptor provides access to MBeans through a communications protocol. It enables management applications to perform management operations on a Java Dynamic Management Kit agent. For a Java Dynamic Management Kit to be manageable, it must contain at least one adaptor. However, a Java Dynamic Management Kit agent can contain many adaptors, allowing it to be managed remotely through different protocols.

The HTML adaptor acts as an HTML server. It enables web browsers to access Java Dynamic Management Kit agents through the HTTP communications protocol, thus, to manage all MBeans in the agent. It may be used as a tool for debugging and speeding the development of Java Dynamic Management Kit agents. The HTML protocol adaptor is implemented as a dynamic MBean.

The HTML protocol adaptor provides the following main HTML pages for managing MBeans in an agent:

The HTML page displayed is generated by the HTML adaptor and enables you to perform the following operations on MBeans in the agent:

The HTML adaptor is an instance of the HtmlAdaptor Server MBean com.sun.jdmk.comm. Your agent application needs to instantiate this class and register the MBean to allow HTML connections. When the HTML protocol adaptor is instantiated it creates a TCP/IP socket, listens for client connections and waits for incoming requests. By default, the HTML adaptor listens for incoming requests on port 8082. This default value can be changed by specifying a port number:

If a client tries to connect, the HtmlAdaptorServer creates a thread which receives and processes all subsequent requests from this client. The number of clients is limited by the maxActiveClientCount property. The default value of the maxActiveClientCount is 10. When an HtmlAdaptorServer is stopped, all current HTTP connections are interrupted (some requests may be terminated abruptly), and the TCP/IP socket is closed. The HtmlAdaptorServer can perform user authentication. The add/remove user authentication info methods can be used to manage users and their corresponding authentication information.

Before connecting a web browser to an agent, make sure that:

To connect a browser to an agent, open the page given by the following URL in a web browser:

http://host:port

where:

There are certain limitations of the HTML protocol adaptor, as follows: