You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2004/06/29 00:25:24 UTC

cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader WebappClassLoader.java

markt       2004/06/28 15:25:24

  Modified:    catalina/src/share/org/apache/catalina/loader
                        WebappClassLoader.java
  Log:
  Port fix for bug 25528 - Poor performance with RMI
  
  Revision  Changes    Path
  1.51      +29 -7     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
  
  Index: WebappClassLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- WebappClassLoader.java	22 Feb 2004 21:04:18 -0000	1.50
  +++ WebappClassLoader.java	28 Jun 2004 22:25:24 -0000	1.51
  @@ -288,6 +288,12 @@
   
   
       /**
  +     * Repositories URLs, used to cache the result of getURLs. 
  +     */ 
  +    protected URL[] repositoryURLs = null; 
  +
  +
  +    /** 
        * Repositories translated as path in the work directory (for Jasper
        * originally), but which is used to generate fake URLs should getURLs be
        * called.
  @@ -565,6 +571,7 @@
               URL url = new URL(repository);
               super.addURL(url);
               hasExternalRepositories = true;
  +            repositoryURLs = null;
           } catch (MalformedURLException e) {
               throw new IllegalArgumentException(e.toString());
           }
  @@ -924,6 +931,15 @@
   
   
       /**
  +     * Add the specified URL to the classloader.
  +     */
  +    protected void addURL(URL url) { 
  +        super.addURL(url); 
  +        hasExternalRepositories = true; 
  +        repositoryURLs = null; 
  +    } 
  +
  +    /**
        * Find the specified class in our local repositories, if possible.  If
        * not found, throw <code>ClassNotFoundException</code>.
        *
  @@ -1478,6 +1494,10 @@
        */
       public URL[] getURLs() {
   
  +        if (repositoryURLs != null) {
  +            return repositoryURLs;
  +        }
  +
           URL[] external = super.getURLs();
   
           int filesLength = files.length;
  @@ -1498,12 +1518,13 @@
                   }
               }
   
  -            return urls;
  -
  +            repositoryURLs = urls; 
  +    
           } catch (MalformedURLException e) {
  -            return (new URL[0]);
  +            repositoryURLs = new URL[0];
           }
   
  +        return repositoryURLs; 
       }
   
   
  @@ -1571,6 +1592,7 @@
           notFoundResources.clear();
           resourceEntries.clear();
           repositories = new String[0];
  +        repositoryURLs = null;
           files = new File[0];
           jarFiles = new JarFile[0];
           jarRealFiles = new File[0];
  
  
  

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