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 server in the agent. (default: 8082)
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.
When the HTML protocol adaptor is started it creates a TCP/IP socket and listens for client connections.
The default port number of the socket is 8082. This default value can be changed by specifying a port number:
- in the object constructor
- using the {@link com.sun.jdmk.comm.CommunicatorServer#setPort setPort} method before starting the adaptor
The default object name is define by {@link com.sun.jdmk.ServiceName#DOMAIN com.sun.jdmk.ServiceName.DOMAIN} and {@link com.sun.jdmk.ServiceName#HTML_ADAPTOR_SERVER com.sun.jdmk.ServiceName.HTML_ADAPTOR_SERVER}.
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. The HTML server uses the 'Basic Authentication Scheme' (as defined in RFC 1945, section 11.1) to authenticate clients connecting to the server.
Limitations of the HTML protocol adaptor:
- 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[]
e.g. 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[]
short Short Short[]
String String[]
com.sun.jdmk.Enumerated
: Supported for readable attributes. As com.sun.jdmk.Enumerated
is an abstract class, only write-only attributes whose actual subclass is declared in the signature of its setter, can be set through the Html adaptor. - For unsupported readable attribute types, if not null, the
toString()
method is called. - If the getter of a readable attribute throw an exception, the thrown exception name and message are displayed, and this attribute cannot be set through the Html Adaptor even though it were a read-write attribute.
- List of supported operation and constructor parameter types:
boolean Boolean
byte Byte
char Character
Date
e.g. September 30, 1999 8:49:04 PM CEST double Double
float Float
int Integer
long Long
Number
javax.management.ObjectName
short Short
String
Note 1: When reading a value of type Number
the server tries to convert it first to an Integer, then a Long, then a Float and finally a Double, stopping at the first which succeeds.
Note 2: Use the "Reload" button displayed in the HTML page of an MBean view rather than the reload button of the web-browser, otherwise you may invoke again the setters of all attributes if this was your last action.