tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup CatalinaService.java
Date Wed, 21 Aug 2002 03:19:36 GMT
costin      2002/08/20 20:19:36

  Modified:    catalina/src/share/org/apache/catalina/startup
                        CatalinaService.java
  Log:
  The patch to set base/home from ant.
  
  Commented out - the IU that also guesses the home ( need to also
  fix build.xml to package it )
  
  Revision  Changes    Path
  1.3       +29 -5     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaService.java
  
  Index: CatalinaService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CatalinaService.java	10 Aug 2002 16:54:15 -0000	1.2
  +++ CatalinaService.java	21 Aug 2002 03:19:36 -0000	1.3
  @@ -81,6 +81,7 @@
   import org.apache.catalina.Loader;
   import org.apache.commons.digester.Digester;
   
  +//import org.apache.tomcat.util.IntrospectionUtils;
   
   /**
    * Startup/Shutdown shell program for Catalina.  The following command line
  @@ -160,9 +161,31 @@
   
       public void setHome( String s ) {
           System.setProperty("catalina.home", s );
  +    }
  +
  +    public void setBase( String s ) {
           System.setProperty("catalina.base", s );
       }
  -    
  +
  +    protected void initHomeAndBase() {
  +        //IntrospectionUtils.guessInstall("catalina.home", "catalina.base", "bootstrap.jar",
  +        //                                "org.apache.catalina.startup.CatalinaService");
  +
  +        String h=System.getProperty("catalina.home");
  +        String b=System.getProperty("catalina.base");
  +        if( h==null && b!=null ) {
  +            setHome( b );
  +            System.out.println("XXX setHome " + b );
  +        } else if( b==null && h!=null ) {
  +            setBase( h );
  +            System.out.println("XXX setBase" + h );
  +        } else if( b!=null && h!=null ) {
  +            return;
  +        } else { // b==null && h==null
  +            // Nothing yet - guessInstall can handle that.
  +        }
  +    }
  +
       public void setUseNaming( boolean b ) {
           useNaming=b;
       }
  @@ -196,6 +219,7 @@
           // make sure the thread loader is set
           log.info("Running tomcat5");
           Thread.currentThread().setContextClassLoader( this.getClass().getClassLoader());
  +        initHomeAndBase();
           if (starting) {
               load();
               start();
  
  
  

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


Mime
View raw message