Java Dynamic Management Kit 5.1 Tools Reference Guide

Chapter 2 The HTML Protocol Adaptor

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

The HTML protocol adaptor acts as an HTML server. It enables web browsers to access agents through the HTTP communications protocol, to manage all MBeans in the agent. The HTML adaptor can be used as a tool for debugging and speeding the development of 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 agen.:

2.1 HTML Connections

The HTML adaptor is an instance of the com.sun.jdmk.comm.HtmlAdaptorServer MBean. Your agent application must instantiate this class, register the MBean, and explicitly start the MBean by invoking its start method to allow HTML connections. When the HTML protocol adaptor is started, it creates a TCP/IP socket, listens for manager connections, and waits for incoming requests. By default, the HTML adaptor listens for incoming requests on port 8082. You can change this default value by specifying a port number:

If a manager tries to connect, the HtmlAdaptorServer creates a thread which receives and processes all subsequent requests from this manager. The number of managers is limited by the maxActiveClientCount property. The default value of the maxActiveClientCount is 10.

When an HtmlAdaptorServer is stopped, all current connections are interrupted (some requests might be terminated abruptly), and the TCP/IP socket is closed. The HtmlAdaptorServer can perform user authentication. The addUserAuthenticationInfo method and the removeUserAuthenticationInfo method can be used to manage users and their corresponding authentication information. The HTML server uses the Basic Authentication Scheme, as defined in RFC 1945, section 11.1, to authenticate clients which connect to the server.

Before connecting a web browser to an agent, you must 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

In the URL above, host is the host name of the machine on which the agent is running. The port is the port number used by the HTML adaptor in the agent. The default port number is 8082.

2.2 Limitations of the HTML Protocol Adaptor

The HTML protocol adaptor has the following limitations: