jfclere     2002/07/09 03:46:17

  Modified:    catalina/src/share/org/apache/catalina/startup
                        BootstrapService.java CatalinaService.java
  Log:
  Allow parameters to the BootstrapService.
  jsvc passes them but they were ignored by the BootstrapService.
  
  Revision  Changes    Path
  1.15      +29 -8     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java
  
  Index: BootstrapService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/BootstrapService.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- BootstrapService.java     20 Feb 2002 01:01:34 -0000      1.14
  +++ BootstrapService.java     9 Jul 2002 10:46:16 -0000       1.15
  @@ -123,6 +123,18 @@
       public void init(DaemonContext context)
           throws Exception {
   
  +        String arguments[] = null;
  +
  +        /* Read the arguments from the Daemon context */
  +        if (context!=null) {
  +            arguments = context.getArguments();
  +            for (int i = 0; i < arguments.length; i++) {
  +                if (arguments[i].equals("-debug")) {
  +                    debug = 1;
  +                }
  +            }
  +        }
  +
           log("Create Catalina server");
   
           // Set Catalina path
  @@ -198,11 +210,20 @@
           catalinaService = startupInstance;
           
           // Call the load() method
  -        if (debug >= 1)
  -            log("Calling startup class load() method");
           methodName = "load";
  -        method = catalinaService.getClass().getMethod(methodName, null);
  -        method.invoke(catalinaService, null);
  +        Object param[];
  +        if (arguments==null || arguments.length==0) {
  +            paramTypes = null;
  +            param = null;
  +        } else {
  +            paramTypes[0] = arguments.getClass();
  +            param = new Object[1];
  +            param[0] = arguments;
  +        }
  +        method = catalinaService.getClass().getMethod(methodName, paramTypes);
  +        if (debug >= 1)
  +            log("Calling startup class " + method);
  +        method.invoke(catalinaService, param);
   
       }
   
  
  
  
  1.7       +19 -4     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java
  
  Index: CatalinaService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- CatalinaService.java      18 Feb 2002 19:59:28 -0000      1.6
  +++ CatalinaService.java      9 Jul 2002 10:46:16 -0000       1.7
  @@ -244,6 +244,21 @@
   
       }
   
  +    /* 
  +     * Load using arguments
  +     */
  +    public void load(String args[]) {
  +
  +        setCatalinaHome();
  +        setCatalinaBase();
  +        try {
  +            if (arguments(args))
  +                load();
  +        } catch (Exception e) {
  +            e.printStackTrace(System.out);
  +        }
  +    }
  +
   
       /**
        * Start a new server instance.
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to