User: reverbel
  Date: 02/03/14 15:37:41

  Modified:    src/main/org/jboss/web WebClassLoader.java WebServer.java
  Log:
  Changed format of the WebClassLoader keys to fix problem with keys that
  contain '/' chars.
  
  Revision  Changes    Path
  1.4       +2 -2      jboss/src/main/org/jboss/web/WebClassLoader.java
  
  Index: WebClassLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/web/WebClassLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebClassLoader.java       11 Mar 2002 01:20:42 -0000      1.3
  +++ WebClassLoader.java       14 Mar 2002 23:37:41 -0000      1.4
  @@ -29,7 +29,7 @@
   @author Sacha Labourey <[EMAIL PROTECTED]>
   @author Vladimir Blagojevic <[EMAIL PROTECTED]>
   @author  <a href="mailto:[EMAIL PROTECTED]";>Francisco Reverbel</a>
  -@version $Revision: 1.3 $
  +@version $Revision: 1.4 $
   */
   public class WebClassLoader extends URLClassLoader
   {
  @@ -54,7 +54,7 @@
           int dot = className.lastIndexOf('.');
           if( dot >= 0 )
               className = className.substring(dot+1);
  -        String key =  className + '@' + hashCode() + '/';
  +        String key =  className + '[' + hashCode() + ']';
           return key;
       }
   
  
  
  
  1.19      +21 -9     jboss/src/main/org/jboss/web/WebServer.java
  
  Index: WebServer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/web/WebServer.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- WebServer.java    11 Mar 2002 01:23:06 -0000      1.18
  +++ WebServer.java    14 Mar 2002 23:37:41 -0000      1.19
  @@ -38,7 +38,7 @@
    *
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    *   @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
  - *   @version $Revision: 1.18 $
  + *   @version $Revision: 1.19 $
    *
    *   Revisions:
    *   
  @@ -207,6 +207,7 @@
               if( codebase.endsWith("/") == false )
                   codebase += '/';
               codebase += key;
  +            codebase += '/';
               try
               {
                   loaderURL = new URL(codebase);
  @@ -267,19 +268,30 @@
                   // Get the requested item from the HTTP header
                   BufferedReader in = new BufferedReader(new 
InputStreamReader(socket.getInputStream()));
                   String rawPath = getPath(in);
  -                // Parse the path into the class loader key and file path
  -                int separator = rawPath.indexOf('/');
  -                String filePath = rawPath.substring(separator+1);
  -                String loaderKey = rawPath.substring(0, separator+1);
  +
  +                // Parse the path into the class loader key and file path.
  +                //
  +                // The class loader key is a string whose format is 
  +                // "ClassName[oid]",  where the oid substring may contain '/'
  +                // chars. The expected form of the raw path is:
  +                //
  +                //     "SomeClassName[some/object/id]/some/file/path"
  +                //
  +                // The class loader key is "SomeClassName[some/object/id]"
  +                // and the file path is "some/file/path"
  +
  +                int endOfKey = rawPath.indexOf(']');
  +                String filePath = rawPath.substring(endOfKey+2);
  +                String loaderKey = rawPath.substring(0, endOfKey+1);
                   log.trace("loaderKey = "+loaderKey);
                   log.trace("filePath = "+filePath);
                   ClassLoader loader = (ClassLoader) loaderMap.get(loaderKey);
                   /* If we did not find a class loader check to see if the raw path
  -                 begins with className + '@' + cl.hashCode() + '/' by looking for
  -                 an '@' char. If it does not and downloadServerClasses is true use
  +                 begins with className + '[' + class loader key + ']' by looking for
  +                 an '[' char. If it does not and downloadServerClasses is true use
                    the thread context class loader and set filePath to the rawPath
                   */
  -                if( loader == null && rawPath.indexOf('@') < 0 && 
downloadServerClasses )
  +                if( loader == null && rawPath.indexOf('[') < 0 && 
downloadServerClasses )
                   {
                      filePath = rawPath;
                      log.trace("No loader, reset filePath = "+filePath);
  @@ -397,7 +409,7 @@
           int dot = className.lastIndexOf('.');
           if( dot >= 0 )
               className = className.substring(dot+1);
  -        String key =  className + '@' + cl.hashCode() + '/';
  +        String key =  className + '[' + cl.hashCode() + ']';
           return key;
       }
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to