A protocol 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 protocol 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:
Agent View: Provides a list of object names of all the MBeans registered in the agent.
Agent Administration: Registers and unregisters MBeans in the agent.
MBean View: Reads and writes MBean attributes and perform operations on MBeans in the agent.
The HTML page displayed is generated by the HTML adaptor and enables you to perform the following operations on MBeans in the agent:
Reading or writing the attributes of an MBean instance.
Performing an operation on an MBean instance.
Instantiating an MBean.
Deleting an MBean.
The HTML adaptor is an instance of the com.sun.jdmk.comm.HtmlAdaptorServer MBean. 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 manager 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:
in the object constructor.
by using the setPort method before starting the adaptor.
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 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. The HTML server uses the Basic Authentication Scheme to authenticate clients connecting to the server.
Before connecting a web browser to an agent, make sure that:
The agent is running on a machine that you can access by using the HTTP protocol.
The agent contains an instance of HTML adaptor.
The compiled MBean classes are stored at a location specified
in the CLASSPATH
environment variable
of the agent.
To connect a browser to an agent, open the page given by the following URL in a web browser:
http://host:port
where:
host is the host name of the machine on which the agent is running.
port is the port number used by the HTML adaptor in the agent; the default port number is 8082.
There are certain limitations of the HTML protocol adaptor, as follows:
The minimum value for the reload period is 5 seconds (0 defaults to no reloading).
Array of class are always displayed in read only mode.
Arrays of dimension 2 and higher are not fully expanded.
List of supported attribute types (for reading and writing):
boolean boolean[] Boolean Boolean[]
byte Byte Byte[]
char char[] Character Character[]
Date Date[] eg. September 30, 1999 8:49:04 PM CEST
double double[] Double Double[]
float float[] Float Float[]
int int[] Integer Integer[]
long Long Long[]
Number
javax.management.ObjectName javax.management.ObjectName[]
com.sun.jdmk.Enumerated[]
short Short Short[]
String String[]
For unsupported readonly attribute types, if not null, the toString() method is called
List of supported operation and constructor parameter types:
boolean Boolean
byte Byte
char Character
Date eg. September 30, 1999 8:49:04 PM CEST
double Double
float Float
int Integer
long Long
Number
javax.management.ObjectName
short Short
String