costin      2002/11/19 16:21:33

  Modified:    catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  Few changes to allow catalina to be loaded from a modeler mbean.
  ( the example using ant is checked in catalina.xml ).
  
  Revision  Changes    Path
  1.10      +43 -9     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Catalina.java     26 Oct 2002 12:29:56 -0000      1.9
  +++ Catalina.java     20 Nov 2002 00:21:33 -0000      1.10
  @@ -144,7 +144,6 @@
        */
       protected boolean stopping = false;
   
  -
       /**
        * Are we using naming ?
        */
  @@ -200,12 +199,14 @@
        * @param args Command line arguments
        */
       public void process(String args[]) {
  +
           setAwait(true);
           setCatalinaHome();
           setCatalinaBase();
           try {
               if (arguments(args)) {
                   if (starting) {
  +                    load(args);
                       start();
                   } else if (stopping) {
                       stopServer();
  @@ -470,7 +471,7 @@
        * Set the <code>catalina.base</code> System property to the current
        * working directory if it has not been set.
        */
  -    protected void setCatalinaBase() {
  +    public void setCatalinaBase() {
   
           if (System.getProperty("catalina.base") != null)
               return;
  @@ -479,12 +480,20 @@
   
       }
   
  +    public void setCatalinaHome( String s ) {
  +        System.out.println("Setting home "+ s);
  +        System.setProperty( "catalina.home", s);
  +    }
  +
  +    public void setCatalinaBase( String s ) {
  +        System.setProperty( "catalina.base", s);
  +    }
   
       /**
        * Set the <code>catalina.home</code> System property to the current
        * working directory if it has not been set.
        */
  -    protected void setCatalinaHome() {
  +    public void setCatalinaHome() {
   
           if (System.getProperty("catalina.home") != null)
               return;
  @@ -493,12 +502,28 @@
   
       }
   
  +    public String getConfigFile() {
  +        return configFile;
  +    }
  +
  +    public boolean isAwait() {
  +        return await;
  +    }
  +
  +    public boolean isDebug() {
  +        return debug;
  +    }
  +
  +    public boolean isUseNaming() {
  +        return useNaming;
  +    }
   
       /**
        * Start a new server instance.
        */
       public void load() {
  -
  +        setCatalinaHome();
  +        setCatalinaBase();
           // Create and execute our Digester
           Digester digester = createStartDigester();
           long t1 = System.currentTimeMillis();
  @@ -575,12 +600,21 @@
           }
       }
   
  +    public void create() {
  +
  +    }
  +
  +    public void destroy() {
  +
  +    }
   
       /**
        * Start a new server instance.
        */
       public void start() {
  -
  +        if( server==null ) {
  +            load();
  +        }
           // Start the new server
           if (server instanceof Lifecycle) {
               try {
  
  
  

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

Reply via email to