tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/common JkMX.java
Date Fri, 07 Jun 2002 00:24:26 GMT
costin      2002/06/06 17:24:24

  Modified:    jk/java/org/apache/jk/common JkMX.java
  Log:
  Support for JMX_RI. ( again, using jmx magic to avoid explicit dependencies )
  
  Revision  Changes    Path
  1.3       +19 -1     jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkMX.java
  
  Index: JkMX.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkMX.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JkMX.java	6 Jun 2002 22:21:04 -0000	1.2
  +++ JkMX.java	7 Jun 2002 00:24:23 -0000	1.3
  @@ -145,8 +145,25 @@
               // starts the server
               mserver.invoke(serverName, "start", null, null);
   
  +            return;
           } catch( Throwable t ) {
  -            log.error( "Init error", t );
  +            log.error( "Can't load the MX4J http adapter " + t.toString()  );
  +        }
  +
  +        try {
  +            Class c=Class.forName( "com.sun.jdmk.comm.HtmlAdaptorServer" );
  +            Object o=c.newInstance();
  +            ObjectName serverName=new ObjectName("Adaptor:name=html,port=" + port);
  +            log.info("Registering the JMX_RI html adapter " + serverName);
  +            mserver.registerMBean(o,  serverName);
  +
  +            mserver.setAttribute(serverName,
  +                                 new Attribute("Port", new Integer(port)));
  +
  +            mserver.invoke(serverName, "start", null, null);
  +
  +        } catch( Throwable t ) {
  +            log.error( "Can't load the JMX_RI http adapter " + t.toString()  );
           }
       }
       public void init() throws IOException {
  @@ -160,6 +177,7 @@
               try {
                   Class c=Class.forName( "org.apache.log4j.jmx.HierarchyDynamicMBean" );
                   Object o=c.newInstance();
  +                log.info("Registering the root hierarchy for JMX ");
                   mserver.registerMBean(o, new ObjectName("log4j:hierarchy=default"));
               } catch( Throwable t ) {
                   log.info("Can't enable log4j mx");
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message