avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader DefaultClassLoaderManager.java
Date Sun, 28 Oct 2001 11:22:34 GMT
donaldp     01/10/28 03:22:34

  Modified:    src/java/org/apache/avalon/phoenix/components/classloader
                        DefaultClassLoaderManager.java
  Log:
  Reowrked DefaultClassLoaderManager to work with new PolicyClassLoader interface.
  
  Revision  Changes    Path
  1.13      +8 -10     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/DefaultClassLoaderManager.java
  
  Index: DefaultClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/DefaultClassLoaderManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultClassLoaderManager.java	2001/10/28 03:52:50	1.12
  +++ DefaultClassLoaderManager.java	2001/10/28 11:22:34	1.13
  @@ -64,7 +64,6 @@
   
           //TODO: Load Extensions from Package Repository as required
   
  -
           //TODO: Determine parentClassLoader in a safer fashion
           final ClassLoader parentClassLoader = Thread.currentThread().getContextClassLoader();
   
  @@ -75,11 +74,15 @@
           {
               final JarFile archive = new JarFile( source, true, JarFile.OPEN_READ );
               factory = new SarURLStreamHandlerFactory( archive );
  +            URL.setURLStreamHandlerFactory( factory );
           }
   
           final URL[] urls = createURLs( classPath, factory );
   
  -        return new PolicyClassLoader( urls, parentClassLoader, factory, policy );
  +        final PolicyClassLoader classLoader = 
  +            new PolicyClassLoader( urls, parentClassLoader, factory, policy );
  +        setupLogger( classLoader, "classloader" );
  +        return classLoader;
       }
   
       /**
  @@ -146,17 +149,12 @@
   
           final String scheme = urlString.substring( 0, index );
   
  -        URL url = null;
  +        URLStreamHandler handler = null;
           if( null != factory )
           {
  -            final URLStreamHandler handler = factory.createURLStreamHandler( scheme );
  -            url = new URL( null, urlString, handler );
  +            handler = factory.createURLStreamHandler( scheme );
           }
  -        else
  -        {
  -            url = new URL( urlString );
  -        }            
   
  -        return url;
  +        return new URL( null, urlString, handler );
       }
   }
  
  
  

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


Mime
View raw message