Package com.sun.jdmk.comm

Examples of com.sun.jdmk.comm.HtmlAdaptorServer

where: The HTML protocol adaptor provides the following main HTML pages for managing MBeans in an 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:

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:


  public
  void start() {

    MBeanServer server = MBeanServerFactory.createMBeanServer();
    HtmlAdaptorServer html = new HtmlAdaptorServer();

    try {
      log.info("Registering HtmlAdaptorServer instance.");
      server.registerMBean(html, new ObjectName("Adaptor:name=html,port=8082"));
      log.info("Registering HierarchyDynamicMBean instance.");
      HierarchyDynamicMBean hdm = new HierarchyDynamicMBean();
      server.registerMBean(hdm, new ObjectName("log4j:hiearchy=default"));

    } catch(Exception e) {
      log.error("Problem while regitering MBeans instances.", e);
      return;
    }
    html.start();
  }
View Full Code Here


      // setup the adapter
      try {
        //instance an html adaptor
        int port = htmlAdapterPort == null ? 8082 : Integer
            .valueOf(htmlAdapterPort);
        html = new HtmlAdaptorServer(port);
        ObjectName htmlName = new ObjectName(JMXFactory
            .getDefaultDomain()
            + ":type=HtmlAdaptorServer,port=" + port);
        log.debug("Created HTML adaptor on port: " + port);
        //add the adaptor to the server
View Full Code Here

  public
  void start() {

    MBeanServer server = MBeanServerFactory.createMBeanServer();
    HtmlAdaptorServer html = new HtmlAdaptorServer();

    try {
      log.info("Registering HtmlAdaptorServer instance.");
      server.registerMBean(html, new ObjectName("Adaptor:name=html,port=8082"));
      log.info("Registering HierarchyDynamicMBean instance.");
      HierarchyDynamicMBean hdm = new HierarchyDynamicMBean();
      server.registerMBean(hdm, new ObjectName("log4j:hiearchy=default"));

    } catch(Exception e) {
      log.error("Problem while regitering MBeans instances.", e);
      return;
    }
    html.start();
  }
View Full Code Here

TOP

Related Classes of com.sun.jdmk.comm.HtmlAdaptorServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.