remm 02/01/17 12:01:02 Modified: catalina/src/share/org/apache/catalina/mbeans MBeanUtils.java ServerLifecycleListener.java Log: - The JMX support can now be built and distributed with an alternate JMX implmentation: OpenJMX. OpenJMX is a Sourceforge project which uses the Apache license, so this should remove the redistribution problems with the JMX RI. Overall, I think OpenJMX is an ideal candidate for distribution with upcoming Tomcat releases. - The build.properties mentions OpenJMX 1.0 b2, which is not released yet. 1.0 b1 will not work, as a few fixes were needed to work with Tomcat. - I don't see any reason why not to enable the JMX support by default once OpenJMX reaches 1.0 status. - Removes use of proprietary APIs from the JMX RI. - Rename the main JMX variable: jmxri.jar -> jmx.jar (the first one implied that the JMX RI is required). Revision Changes Path 1.8 +4 -5 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java Index: MBeanUtils.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- MBeanUtils.java 14 Jan 2002 21:42:37 -0000 1.7 +++ MBeanUtils.java 17 Jan 2002 20:01:02 -0000 1.8 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v 1.7 2002/01/14 21:42:37 amyroh Exp $ - * $Revision: 1.7 $ - * $Date: 2002/01/14 21:42:37 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java,v 1.8 2002/01/17 20:01:02 remm Exp $ + * $Revision: 1.8 $ + * $Date: 2002/01/17 20:01:02 $ * * ==================================================================== * @@ -76,7 +76,6 @@ import javax.management.OperationsException; import javax.management.modelmbean.InvalidTargetObjectTypeException; import javax.management.modelmbean.ModelMBean; -import com.sun.management.jmx.Trace; import org.apache.catalina.Connector; import org.apache.catalina.Container; import org.apache.catalina.Context; @@ -104,7 +103,7 @@ * * @author Craig R. McClanahan * @author Amy Roh - * @version $Revision: 1.7 $ $Date: 2002/01/14 21:42:37 $ + * @version $Revision: 1.8 $ $Date: 2002/01/17 20:01:02 $ */ public class MBeanUtils { 1.7 +4 -101 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java Index: ServerLifecycleListener.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ServerLifecycleListener.java 14 Jan 2002 21:42:37 -0000 1.6 +++ ServerLifecycleListener.java 17 Jan 2002 20:01:02 -0000 1.7 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v 1.6 2002/01/14 21:42:37 amyroh Exp $ - * $Revision: 1.6 $ - * $Date: 2002/01/14 21:42:37 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java,v 1.7 2002/01/17 20:01:02 remm Exp $ + * $Revision: 1.7 $ + * $Date: 2002/01/17 20:01:02 $ * * ==================================================================== * @@ -71,8 +71,6 @@ import javax.management.MBeanException; import javax.management.MBeanServer; import javax.management.ObjectName; -import com.sun.jdmk.comm.AuthInfo; -import com.sun.jdmk.comm.HtmlAdaptorServer; import org.apache.catalina.Connector; import org.apache.catalina.Container; import org.apache.catalina.ContainerEvent; @@ -100,22 +98,13 @@ * * @author Craig R. McClanahan * @author Amy Roh - * @version $Revision: 1.6 $ $Date: 2002/01/14 21:42:37 $ + * @version $Revision: 1.7 $ $Date: 2002/01/17 20:01:02 $ */ public class ServerLifecycleListener implements ContainerListener, LifecycleListener { - // ----------------------------------------------------- Instance Variables - - - /** - * The HtmlAdaptorServer to be executed (if any). - */ - protected HtmlAdaptorServer adaptor = null; - - // ------------------------------------------------------------- Properties @@ -133,51 +122,6 @@ } - /** - * The port number for the <code>HtmlAdaptorServer</code> to be created, - * or -1 for no adaptor. - */ - protected int port = -1; - - public int getPort() { - return (this.port); - } - - public void setPort(int port) { - this.port = port; - } - - - /** - * The login used for the authentication by the - * <code>HtmlAdaptorServer</code>. - */ - protected String login = null; - - public String getLogin() { - return (this.login); - } - - public void setLogin(String login) { - this.login = login; - } - - - /** - * The password used for the authentication by the - * <code>HtmlAdaptorServer</code>. - */ - protected String password = null; - - public String getPassword() { - return (this.password); - } - - public void setPassword(String password) { - this.password = password; - } - - // ---------------------------------------------- ContainerListener Methods @@ -219,9 +163,7 @@ if (Lifecycle.START_EVENT.equals(event.getType())) { createMBeans(); - createAdaptor(); } else if (Lifecycle.STOP_EVENT.equals(event.getType())) { - destroyAdaptor(); } } @@ -231,32 +173,6 @@ /** - * Create the HTML Adaptor to respond to management requests. - */ - protected void createAdaptor() { - - if (port <= 0) - return; - - try { - adaptor = new HtmlAdaptorServer(port); - if (login != null) { - adaptor.addUserAuthenticationInfo - (new AuthInfo(getLogin(), getPassword())); - } - ObjectName name = - new ObjectName("Adaptor:name=html,port=" + port); - MBeanUtils.createServer().registerMBean(adaptor, name); - adaptor.start(); - } catch (Throwable t) { - t.printStackTrace(System.out); - System.exit(1); - } - - } - - - /** * Create the MBeans that correspond to every node of our tree. */ protected void createMBeans() { @@ -360,19 +276,6 @@ log("createMBeans: Throwable", t); } - - } - - - /** - * Destroy the HtmlAdaptorServer we created (if any). - */ - protected void destroyAdaptor() { - - if (adaptor == null) - return; - adaptor.stop(); - adaptor = null; }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>