tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Bootstrap.java
Date Tue, 02 Mar 2004 12:32:08 GMT
remm        2004/03/02 04:32:08

  Modified:    catalina/src/share/org/apache/catalina/startup
                        Bootstrap.java
  Log:
  - Register all classloaders with JMX, so that Tomcat is actually manageable
    through JMX remote (otherwise, instantiating a new MBean is not possible).
  
  Revision  Changes    Path
  1.17      +22 -2     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java
  
  Index: Bootstrap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Bootstrap.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Bootstrap.java	27 Feb 2004 14:58:48 -0000	1.16
  +++ Bootstrap.java	2 Mar 2004 12:32:08 -0000	1.17
  @@ -25,6 +25,10 @@
   import java.util.ArrayList;
   import java.util.StringTokenizer;
   
  +import javax.management.MBeanServer;
  +import javax.management.MBeanServerFactory;
  +import javax.management.ObjectName;
  +
   import org.apache.catalina.security.SecurityClassLoad;
   
   
  @@ -143,8 +147,24 @@
           File[] packed = (File[]) packedList.toArray(new File[0]);
           URL[] urls = (URL[]) urlList.toArray(new URL[0]);
   
  -        return ClassLoaderFactory.createClassLoader
  +        ClassLoader classLoader = ClassLoaderFactory.createClassLoader
               (unpacked, packed, urls, parent);
  +
  +        // Retrieving MBean server
  +        MBeanServer mBeanServer = null;
  +        if (MBeanServerFactory.findMBeanServer(null).size() > 0) {
  +            mBeanServer = 
  +                (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
  +        } else {
  +            mBeanServer = MBeanServerFactory.createMBeanServer();
  +        }
  +
  +        // Register the server classloader
  +        ObjectName objectName = 
  +            new ObjectName("Catalina:type=ServerClassLoader,name=" + name);
  +        mBeanServer.registerMBean(classLoader, objectName);
  +
  +        return classLoader;
   
       }
   
  
  
  

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


Mime
View raw message