You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by am...@apache.org on 2002/05/01 02:38:11 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans ConnectorMBean.java MBeanFactory.java

amyroh      02/04/30 17:38:10

  Modified:    catalina/src/share/org/apache/catalina/mbeans
                        ConnectorMBean.java MBeanFactory.java
  Log:
  Minor fixes to edit serversocketfactory properties.
  
  Revision  Changes    Path
  1.3       +48 -47    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java
  
  Index: ConnectorMBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectorMBean.java	30 Apr 2002 18:24:08 -0000	1.2
  +++ ConnectorMBean.java	1 May 2002 00:38:09 -0000	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java,v 1.2 2002/04/30 18:24:08 amyroh Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/04/30 18:24:08 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java,v 1.3 2002/05/01 00:38:09 amyroh Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/05/01 00:38:09 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    * <code>org.apache.coyote.tomcat4.CoyoteConnector</code> component.</p>
    *
    * @author Amy Roh
  - * @version $Revision: 1.2 $ $Date: 2002/04/30 18:24:08 $
  + * @version $Revision: 1.3 $ $Date: 2002/05/01 00:38:09 $
    */
   
   public class ConnectorMBean extends BaseModelMBean {
  @@ -108,6 +108,7 @@
   
       // ------------------------------------------------------------- Operations
   
  +    
       /**
        * Return Client authentication info
        *
  @@ -120,17 +121,13 @@
           Class coyoteConnectorCls = Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
           if (coyoteConnectorCls.isInstance(this.resource)) {
               // get factory
  -            Class partypes1 [] = new Class[1];
  -            Method meth1 = coyoteConnectorCls.getMethod("getFactory", partypes1);
  -            Object arglist1[] = new Object[1];
  -            Object factory = meth1.invoke(this.resource, arglist1);
  +            Method meth1 = coyoteConnectorCls.getMethod("getFactory", null);
  +            Object factory = meth1.invoke(this.resource, null);
               Class coyoteServerSocketFactoryCls = Class.forName("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
               if (coyoteServerSocketFactoryCls.isInstance(factory)) {
                   // get clientAuth
  -                Class partypes2 [] = new Class[1];
  -                Method meth2 = coyoteServerSocketFactoryCls.getMethod("getClientAuth", partypes2);
  -                Object arglist2[] = new Object[1];
  -                clientAuthObj = meth2.invoke(this.resource, arglist2);
  +                Method meth2 = coyoteServerSocketFactoryCls.getMethod("getClientAuth", null);
  +                clientAuthObj = meth2.invoke(this.resource, null);
               }
              
           }    
  @@ -139,6 +136,7 @@
           else return false;
       }
       
  +    
       /**
        * Set Client authentication info
        *
  @@ -150,10 +148,8 @@
           Class coyoteConnectorCls = Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
           if (coyoteConnectorCls.isInstance(this.resource)) {
               // get factory
  -            Class partypes1 [] = new Class[1];
  -            Method meth1 = coyoteConnectorCls.getMethod("getFactory", partypes1);
  -            Object arglist1[] = new Object[1];
  -            Object factory = meth1.invoke(this.resource, arglist1);
  +            Method meth1 = coyoteConnectorCls.getMethod("getFactory", null);
  +            Object factory = meth1.invoke(this.resource, null);
               Class coyoteServerSocketFactoryCls = Class.forName("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
               if (coyoteServerSocketFactoryCls.isInstance(factory)) {
                   // set clientAuth
  @@ -163,9 +159,9 @@
                   Object arglist2[] = new Object[1];
                   arglist2[0] = new Boolean(clientAuth);
                   meth2.invoke(this.resource, arglist2);
  -            }
  -           
  -        }    
  +            } 
  +        } 
  +        
       }
   
       
  @@ -181,21 +177,22 @@
           Class coyoteConnectorCls = Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
           if (coyoteConnectorCls.isInstance(this.resource)) {
               // get keystoreFile
  -            Class partypes1 [] = new Class[1];
  -            Method meth1 = coyoteConnectorCls.getMethod("getKeystoreFile", partypes1);
  -            Object arglist1[] = new Object[1];
  -            Object factory = meth1.invoke(this.resource, arglist1);
  +            Method meth1 = coyoteConnectorCls.getMethod("getFactory", null);
  +            Object factory = meth1.invoke(this.resource, null);
               Class coyoteServerSocketFactoryCls = Class.forName("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
               if (coyoteServerSocketFactoryCls.isInstance(factory)) {
                   // get keystoreFile
  -                Class partypes2 [] = new Class[1];
  -                Method meth2 = coyoteServerSocketFactoryCls.getMethod("getKeystoreFile", partypes2);
  -                Object arglist2[] = new Object[1];
  -                keystoreFileObj = meth2.invoke(this.resource, arglist2);
  +                Method meth2 = coyoteServerSocketFactoryCls.getMethod("getKeystoreFile", null);
  +                keystoreFileObj = meth2.invoke(this.resource, null);
               }
  -           
           }    
  -        return keystoreFileObj.toString();
  +        
  +        if (keystoreFileObj == null) {
  +            return null;
  +        } else {
  +            return keystoreFileObj.toString();
  +        }
  +        
       }
       
       
  @@ -206,14 +203,15 @@
        */
       public void setKeystoreFile(String keystoreFile)
           throws Exception {
  -            
  +        
  +        if (keystoreFile == null) {
  +            keystoreFile = "";
  +        }
           Class coyoteConnectorCls = Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
           if (coyoteConnectorCls.isInstance(this.resource)) {
               // get factory
  -            Class partypes1 [] = new Class[1];
  -            Method meth1 = coyoteConnectorCls.getMethod("getFactory", partypes1);
  -            Object arglist1[] = new Object[1];
  -            Object factory = meth1.invoke(this.resource, arglist1);
  +            Method meth1 = coyoteConnectorCls.getMethod("getFactory", null);
  +            Object factory = meth1.invoke(this.resource, null);
               Class coyoteServerSocketFactoryCls = Class.forName("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
               if (coyoteServerSocketFactoryCls.isInstance(factory)) {
                   // set keystoreFile
  @@ -242,21 +240,23 @@
           Class coyoteConnectorCls = Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
           if (coyoteConnectorCls.isInstance(this.resource)) {
               // get factory
  -            Class partypes1 [] = new Class[1];
  -            Method meth1 = coyoteConnectorCls.getMethod("getKeystoreFile", partypes1);
  -            Object arglist1[] = new Object[1];
  -            Object factory = meth1.invoke(this.resource, arglist1);
  +            Method meth1 = coyoteConnectorCls.getMethod("getFactory", null);
  +            Object factory = meth1.invoke(this.resource, null);
               Class coyoteServerSocketFactoryCls = Class.forName("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
               if (coyoteServerSocketFactoryCls.isInstance(factory)) {
                   // get keystorePass
  -                Class partypes2 [] = new Class[1];
  -                Method meth2 = coyoteServerSocketFactoryCls.getMethod("getKeystorePass", partypes2);
  -                Object arglist2[] = new Object[1];
  -                keystorePassObj = meth2.invoke(this.resource, arglist2);
  +                Method meth2 = coyoteServerSocketFactoryCls.getMethod("getKeystorePass", null);
  +                keystorePassObj = meth2.invoke(this.resource, null);
               }
              
           }    
  -        return keystorePassObj.toString();
  +        
  +        if (keystorePassObj == null) {
  +            return null;
  +        } else {
  +            return keystorePassObj.toString();
  +        }
  +        
       }
       
       
  @@ -268,13 +268,14 @@
       public void setKeystorePass(String keystorePass)
           throws Exception {
               
  +        if (keystorePass == null) {
  +            keystorePass = "";
  +        }
           Class coyoteConnectorCls = Class.forName("org.apache.coyote.tomcat4.CoyoteConnector");
           if (coyoteConnectorCls.isInstance(this.resource)) {
               // get factory
  -            Class partypes1 [] = new Class[1];
  -            Method meth1 = coyoteConnectorCls.getMethod("getFactory", partypes1);
  -            Object arglist1[] = new Object[1];
  -            Object factory = meth1.invoke(this.resource, arglist1);
  +            Method meth1 = coyoteConnectorCls.getMethod("getFactory", null);
  +            Object factory = meth1.invoke(this.resource, null);
               Class coyoteServerSocketFactoryCls = Class.forName("org.apache.coyote.tomcat4.CoyoteServerSocketFactory");
               if (coyoteServerSocketFactoryCls.isInstance(factory)) {
                   // set keystorePass
  
  
  
  1.28      +5 -5      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java
  
  Index: MBeanFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- MBeanFactory.java	30 Apr 2002 03:25:22 -0000	1.27
  +++ MBeanFactory.java	1 May 2002 00:38:09 -0000	1.28
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v 1.27 2002/04/30 03:25:22 amyroh Exp $
  - * $Revision: 1.27 $
  - * $Date: 2002/04/30 03:25:22 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java,v 1.28 2002/05/01 00:38:09 amyroh Exp $
  + * $Revision: 1.28 $
  + * $Date: 2002/05/01 00:38:09 $
    *
    * ====================================================================
    *
  @@ -117,7 +117,7 @@
    * <code>org.apache.catalina.core.StandardServer</code> component.</p>
    *
    * @author Amy Roh
  - * @version $Revision: 1.27 $ $Date: 2002/04/30 03:25:22 $
  + * @version $Revision: 1.28 $ $Date: 2002/05/01 00:38:09 $
    */
   
   public class MBeanFactory extends BaseModelMBean {
  @@ -261,7 +261,7 @@
               Method meth3 = cls.getMethod("setProtocolHandlerClassName", partypes3);
               Object arglist3[] = new Object[1];
               arglist3[0] = new String("org.apache.jk.server.JkCoyoteHandler");
  -            meth3.invoke(retobj, arglist2);
  +            meth3.invoke(retobj, arglist3);
   
           } catch (Exception e) {
               throw new MBeanException(e);
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>