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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]