remm        01/06/20 18:39:10

  Modified:    catalina/src/share/org/apache/catalina/loader
                        LocalStrings.properties WebappLoader.java
  Log:
  - Add additional log info so that I can figure out what's up with Scarab
    running on Jon's box. It's no longer displayed on the console, but instead
    put in the log files.
  - Rename StandardLoader -> WebappLoader in the logs.
  - Add additional message strings.
  
  Revision  Changes    Path
  1.2       +14 -0     
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LocalStrings.properties   2000/08/11 22:42:03     1.1
  +++ LocalStrings.properties   2001/06/21 01:39:07     1.2
  @@ -13,3 +13,17 @@
   standardLoader.removeRepository=Removing repository {0}
   standardLoader.starting=Starting this Loader
   standardLoader.stopping=Stopping this Loader
  +webappLoader.addRepository=Adding repository {0}
  +webappLoader.deploy=Deploying class repositories to work directory {0}
  +webappLoader.jarDeploy=Deploy JAR {0} to {1}
  +webappLoader.classDeploy=Deploy class files {0} to {1}
  +webappLoader.alreadyStarted=Loader has already been started
  +webappLoader.checkInterval=Cannot set reload check interval to {0} seconds
  +webappLoader.notContext=Cannot auto-reload unless our Container is a Context
  +webappLoader.notReloadabe=Reloadable property is set to false
  +webappLoader.notStarted=Loader has not yet been started
  +webappLoader.reloadable=Cannot set reloadable property to {0}
  +webappLoader.reloading=Reloading checks are enabled for this Context
  +webappLoader.removeRepository=Removing repository {0}
  +webappLoader.starting=Starting this Loader
  +webappLoader.stopping=Stopping this Loader
  
  
  
  1.6       +27 -23    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java
  
  Index: WebappLoader.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WebappLoader.java 2001/06/20 23:31:29     1.5
  +++ WebappLoader.java 2001/06/21 01:39:08     1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.5 2001/06/20 23:31:29 remm Exp $
  - * $Revision: 1.5 $
  - * $Date: 2001/06/20 23:31:29 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappLoader.java,v
 1.6 2001/06/21 01:39:08 remm Exp $
  + * $Revision: 1.6 $
  + * $Date: 2001/06/21 01:39:08 $
    *
    * ====================================================================
    *
  @@ -119,7 +119,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.5 $ $Date: 2001/06/20 23:31:29 $
  + * @version $Revision: 1.6 $ $Date: 2001/06/21 01:39:08 $
    */
   
   public class WebappLoader
  @@ -130,7 +130,7 @@
   
   
       /**
  -     * Construct a new StandardLoader with no defined parent class loader
  +     * Construct a new WebappLoader with no defined parent class loader
        * (so that the actual parent will be the system class loader).
        */
       public WebappLoader() {
  @@ -141,7 +141,7 @@
   
   
       /**
  -     * Construct a new StandardLoader with the specified class loader
  +     * Construct a new WebappLoader with the specified class loader
        * to be defined as the parent of the ClassLoader we ultimately create.
        *
        * @param parent The parent class loader
  @@ -264,7 +264,7 @@
       /**
        * Name to register for the background thread.
        */
  -    private String threadName = "StandardLoader";
  +    private String threadName = "WebappLoader";
   
   
       /**
  @@ -492,7 +492,7 @@
       public void addRepository(String repository) {
   
           if (debug >= 1)
  -         log(sm.getString("standardLoader.addRepository", repository));
  +         log(sm.getString("webappLoader.addRepository", repository));
           for (int i = 0; i < repositories.length; i++) {
               if (repository.equals(repositories[i]))
                   return;
  @@ -591,9 +591,9 @@
        // Validate and update our current component state
        if (started)
            throw new LifecycleException
  -             (sm.getString("standardLoader.alreadyStarted"));
  +             (sm.getString("webappLoader.alreadyStarted"));
        if (debug >= 1)
  -         log(sm.getString("standardLoader.starting"));
  +         log(sm.getString("webappLoader.starting"));
        lifecycle.fireLifecycleEvent(START_EVENT, null);
        started = true;
   
  @@ -668,7 +668,7 @@
   
        // Start our background thread if we are reloadable
        if (reloadable) {
  -         log(sm.getString("standardLoader.reloading"));
  +         log(sm.getString("webappLoader.reloading"));
            try {
                threadStart();
            } catch (IllegalStateException e) {
  @@ -689,9 +689,9 @@
        // Validate and update our current component state
        if (!started)
            throw new LifecycleException
  -             (sm.getString("standardLoader.notStarted"));
  +             (sm.getString("webappLoader.notStarted"));
        if (debug >= 1)
  -         log(sm.getString("standardLoader.stopping"));
  +         log(sm.getString("webappLoader.stopping"));
        lifecycle.fireLifecycleEvent(STOP_EVENT, null);
        started = false;
   
  @@ -736,7 +736,7 @@
                setReloadable
                    ( ((Boolean) event.getNewValue()).booleanValue() );
            } catch (NumberFormatException e) {
  -             log(sm.getString("standardLoader.reloadable",
  +             log(sm.getString("webappLoader.reloadable",
                                 event.getNewValue().toString()));
            }
        }
  @@ -758,13 +758,13 @@
        if (container != null)
            logger = container.getLogger();
        if (logger != null)
  -         logger.log("StandardLoader[" + container.getName() + "]: "
  +         logger.log("WebappLoader[" + container.getName() + "]: "
                       + message);
        else {
            String containerName = null;
            if (container != null)
                containerName = container.getName();
  -         System.out.println("StandardLoader[" + containerName
  +         System.out.println("WebappLoader[" + containerName
                               + "]: " + message);
        }
   
  @@ -783,13 +783,13 @@
        if (container != null)
            logger = container.getLogger();
        if (logger != null) {
  -         logger.log("StandardLoader[" + container.getName() + "] "
  +         logger.log("WebappLoader[" + container.getName() + "] "
                       + message, throwable);
        } else {
            String containerName = null;
            if (container != null)
                containerName = container.getName();
  -         System.out.println("StandardLoader[" + containerName
  +         System.out.println("WebappLoader[" + containerName
                               + "]: " + message);
            System.out.println("" + throwable);
            throwable.printStackTrace(System.out);
  @@ -829,6 +829,8 @@
           if (workDir == null)
               return;
   
  +        log(sm.getString("webappLoader.deploy", workDir.getAbsolutePath()));
  +
           // Reset repositories
           repositories = new String[0];
   
  @@ -871,7 +873,8 @@
                   classRepository.mkdirs();
                   classpath.append(classRepository.getAbsolutePath());
                   
  -                System.out.println("Deploy class files: " + classesPath + " To: " + 
classRepository.getAbsolutePath());
  +                log(sm.getString("webappLoader.classDeploy", classesPath,
  +                                 classRepository.getAbsolutePath()));
                   
                   copyDir(classes, classRepository);
                   
  @@ -922,7 +925,8 @@
                       // impossible to update it or remove it at runtime)
                       File destFile = new File(destDir, binding.getName());
   
  -                    System.out.println("Deploy JAR: " + filename + " To: " + 
destFile.getAbsolutePath());
  +                    log(sm.getString("webappLoader.jarDeploy", filename,
  +                                     destFile.getAbsolutePath()));
                       
                       Resource jarResource = (Resource) binding.getObject();
                       if (copy(jarResource.streamContent(), 
  @@ -1099,16 +1103,16 @@
        // Validate our current state
        if (!reloadable)
            throw new IllegalStateException
  -             (sm.getString("standardLoader.notReloadable"));
  +             (sm.getString("webappLoader.notReloadable"));
        if (!(container instanceof Context))
            throw new IllegalStateException
  -             (sm.getString("standardLoader.notContext"));
  +             (sm.getString("webappLoader.notContext"));
   
        // Start the background thread
        if (debug >= 1)
            log(" Starting background thread");
        threadDone = false;
  -     threadName = "StandardLoader[" + container.getName() + "]";
  +     threadName = "WebappLoader[" + container.getName() + "]";
        thread = new Thread(this, threadName);
        thread.setDaemon(true);
        thread.start();
  
  
  

Reply via email to