You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2004/02/26 07:04:41 UTC

cvs commit: jakarta-tomcat/proposals/JmxSupport/WEB-INF/classes/org/apache/tomcat/modules/config DynamicMBeanProxy.java MxInterceptor.java

billbarker    2004/02/25 22:04:41

  Modified:    proposals/JmxSupport build.xml
               proposals/JmxSupport/WEB-INF interceptors.xml
               proposals/JmxSupport/WEB-INF/classes/org/apache/tomcat/modules/config
                        DynamicMBeanProxy.java MxInterceptor.java
  Log:
  Register the Coyote Protocol and sub-components.
  
  Also updating license to Apache v2.0.
  
  Revision  Changes    Path
  1.4       +19 -3     jakarta-tomcat/proposals/JmxSupport/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/JmxSupport/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml	11 Feb 2004 16:24:14 -0000	1.3
  +++ build.xml	26 Feb 2004 06:04:41 -0000	1.4
  @@ -1,5 +1,20 @@
   <?xml version="1.0"?> 
  -<project name="PasswordPrompter" default="main" basedir=".">
  +<!--
  +   Copyright 1999-2004 The Apache Software Foundation
  + 
  +   Licensed under the Apache License, Version 2.0 (the "License");
  +   you may not use this file except in compliance with the License.
  +   You may obtain a copy of the License at
  + 
  +       http://www.apache.org/licenses/LICENSE-2.0
  + 
  +   Unless required by applicable law or agreed to in writing, software
  +   distributed under the License is distributed on an "AS IS" BASIS,
  +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  +   See the License for the specific language governing permissions and
  +   limitations under the License.
  +-->
  +<project name="JMXSupport" default="main" basedir=".">
   
     <!-- Compilation properties -->
   
  @@ -20,7 +35,7 @@
   
     <property name="jmx.jar" location="${jakarta-tomcat-connectors}/lib/mx4j-jmx.jar"/>
     <property name="jmxtools.jar" location="${jakarta-tomcat-connectors}/lib/mx4j-tools.jar"/>
  -
  +  <property name="commons-modeler.jar" location="${commons-modeler.lib}/commons-modeler.jar" />
     <property name="tomcat.classes.dir" location="${tomcat.build}/classes"/>
     <property name="tomcat.classes" value="${tomcat.classes.dir}"/>
   
  @@ -62,6 +77,7 @@
          <classpath location="${jmx.jar}"/>
          <classpath location="${jmxtools.jar}"/>
          <classpath location="${commons-logging.jar}"/>
  +       <classpath location="${commons-modeler.jar}" />
       </javac>
   
       <mkdir dir="${tomcat.build.modules}/JmxSupport/WEB-INF/lib"/>
  @@ -69,7 +85,7 @@
       <copy todir="${tomcat.build.modules}/JmxSupport/WEB-INF/lib" file="${jmx.jar}"/>
       <copy todir="${tomcat.build.modules}/JmxSupport/WEB-INF/lib" file="${jmxtools.jar}"/>
       <copy todir="${tomcat.build.modules}/JmxSupport/WEB-INF/lib" file="${commons-logging.jar}"/>
  -
  +    <copy todir="${tomcat.build.modules}/JmxSupport/WEB-INF/lib" file="${commons-modeler.jar}"/>
       <jar jarFile="${tomcat.build.modules}/JmxSupport/WEB-INF/lib/JmxSupport.jar"
            basedir="${tomcat.build.modules}/JmxSupport/WEB-INF/classes"/>
   
  
  
  
  1.3       +16 -1     jakarta-tomcat/proposals/JmxSupport/WEB-INF/interceptors.xml
  
  Index: interceptors.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/JmxSupport/WEB-INF/interceptors.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- interceptors.xml	13 Oct 2003 09:45:13 -0000	1.2
  +++ interceptors.xml	26 Feb 2004 06:04:41 -0000	1.3
  @@ -1,4 +1,19 @@
   <?xml version="1.0" encoding="UTF-8"?>
  +<!--
  +   Copyright 1999-2004 The Apache Software Foundation
  + 
  +   Licensed under the Apache License, Version 2.0 (the "License");
  +   you may not use this file except in compliance with the License.
  +   You may obtain a copy of the License at
  + 
  +       http://www.apache.org/licenses/LICENSE-2.0
  + 
  +   Unless required by applicable law or agreed to in writing, software
  +   distributed under the License is distributed on an "AS IS" BASIS,
  +   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  +   See the License for the specific language governing permissions and
  +   limitations under the License.
  +-->
   <Server>
       <module name="MxInterceptor" javaClass="org.apache.tomcat.modules.config.MxInterceptor" />
       <ContextManager>
  @@ -27,7 +42,7 @@
               use the http adaptor
               
           -->
  -        <MxInterceptor port="8999" authentication="basic" 
  +        <MxInterceptor port="-1" authentication="basic" 
                          user="admin" password="changeit"
               />
       </ContextManager>
  
  
  
  1.3       +13 -56    jakarta-tomcat/proposals/JmxSupport/WEB-INF/classes/org/apache/tomcat/modules/config/DynamicMBeanProxy.java
  
  Index: DynamicMBeanProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/JmxSupport/WEB-INF/classes/org/apache/tomcat/modules/config/DynamicMBeanProxy.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DynamicMBeanProxy.java	29 Sep 2003 07:38:10 -0000	1.2
  +++ DynamicMBeanProxy.java	26 Feb 2004 06:04:41 -0000	1.3
  @@ -1,61 +1,18 @@
   /*
  - * ====================================================================
  + *  Copyright 1999-2004 The Apache Software Foundation
    *
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowlegement may appear in the software itself,
  - *    if and wherever such third-party acknowlegements normally appear.
  - *
  - * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
  - *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  - *    permission, please contact apache@apache.org.
  - *
  - * 5. Products derived from this software may not be called "Apache"
  - *    nor may "Apache" appear in their names without prior written
  - *    permission of the Apache Group.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - *
  - * [Additional notices, if required by prior licensing conditions]
  - *
  - */ 
  + *  Licensed under the Apache License, Version 2.0 (the "License");
  + *  you may not use this file except in compliance with the License.
  + *  You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + *  Unless required by applicable law or agreed to in writing, software
  + *  distributed under the License is distributed on an "AS IS" BASIS,
  + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + *  See the License for the specific language governing permissions and
  + *  limitations under the License.
  + */
   
   package org.apache.tomcat.modules.config;
   
  
  
  
  1.3       +32 -53    jakarta-tomcat/proposals/JmxSupport/WEB-INF/classes/org/apache/tomcat/modules/config/MxInterceptor.java
  
  Index: MxInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/JmxSupport/WEB-INF/classes/org/apache/tomcat/modules/config/MxInterceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MxInterceptor.java	29 Sep 2003 07:38:10 -0000	1.2
  +++ MxInterceptor.java	26 Feb 2004 06:04:41 -0000	1.3
  @@ -1,61 +1,20 @@
   /* $Id$
  - * ====================================================================
    *
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution, if
  - *    any, must include the following acknowlegement:  
  - *       "This product includes software developed by the 
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowlegement may appear in the software itself,
  - *    if and wherever such third-party acknowlegements normally appear.
  - *
  - * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
  - *    Foundation" must not be used to endorse or promote products derived
  - *    from this software without prior written permission. For written 
  - *    permission, please contact apache@apache.org.
  - *
  - * 5. Products derived from this software may not be called "Apache"
  - *    nor may "Apache" appear in their names without prior written
  - *    permission of the Apache Group.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - *
  - * [Additional notices, if required by prior licensing conditions]
  + *  Copyright 1999-2004 The Apache Software Foundation
    *
  + *  Licensed under the Apache License, Version 2.0 (the "License");
  + *  you may not use this file except in compliance with the License.
  + *  You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + *  Unless required by applicable law or agreed to in writing, software
  + *  distributed under the License is distributed on an "AS IS" BASIS,
  + *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + *  See the License for the specific language governing permissions and
  + *  limitations under the License.
    */
  +
   package org.apache.tomcat.modules.config;
   
   import java.io.IOException;
  @@ -68,6 +27,7 @@
   import mx4j.adaptor.rmi.jrmp.JRMPAdaptorMBean;
   import mx4j.tools.naming.NamingServiceMBean;
   import mx4j.util.StandardMBeanProxy;
  +import org.apache.commons.modeler.Registry;
   
   import org.apache.tomcat.core.BaseInterceptor;
   import org.apache.tomcat.core.Context;
  @@ -90,6 +50,7 @@
       private String user;
       private String password;
       private String type = "http";
  +    private int protocolNote;
       
       // -------------------- Tomcat callbacks --------------------
   
  @@ -266,6 +227,24 @@
   			loadHTTPAdaptor();
       }
       	
  +
  +    public void engineInit(ContextManager cm) throws TomcatException {
  +	protocolNote = cm.getNoteId(ContextManager.MODULE_NOTE,
  +				    "coyote.protocol");
  +	BaseInterceptor[] modules = cm.getContainer().getInterceptors();
  +	for(int i=0; i < modules.length; i++) {
  +	    Object proto = modules[i].getNote(protocolNote);
  +	    if(proto != null) {
  +		try {
  +		    Registry.getRegistry(null,null).registerComponent
  +			(proto, "tomcat3:type=ProtocolHandler,className="+
  +			   proto.getClass().getName(),"ProtocolHandler");
  +		}catch(Exception ex) {
  +		    log("Error registering Protocol",ex);
  +		}
  +	    }
  +	}
  +    }
   
       public void destroy() {
           try {
  
  
  

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