ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/launcher Main.java LauncherClassLoader.java
Date Thu, 31 May 2001 09:25:26 GMT
donaldp     01/05/31 02:25:25

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/launcher
                        Main.java
  Removed:     proposal/myrmidon/src/java/org/apache/myrmidon/launcher
                        LauncherClassLoader.java
  Log:
  Simplified Classloader management.
  
  Assume all jar/zip files in lib path are sucked into runtime.
  Assume that there is no difference between engine and client classes (mainly so as to make
it easier to manage engine interaction via task registration et-al) without proliferating
a billion jars.
  
  Revision  Changes    Path
  1.4       +12 -1     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/launcher/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/launcher/Main.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Main.java	2001/05/29 15:24:18	1.3
  +++ Main.java	2001/05/31 09:25:21	1.4
  @@ -11,6 +11,7 @@
   import java.lang.reflect.InvocationTargetException;
   import java.lang.reflect.Method;
   import java.net.URL;
  +import java.net.URLClassLoader;
   import java.util.ArrayList;
   import java.util.StringTokenizer;
   
  @@ -41,12 +42,14 @@
               final File libDir = new File( installDirectory, "lib" );
               final URL[] urls = buildURLList( libDir );
   
  -            final LauncherClassLoader classLoader = new LauncherClassLoader( urls );
  +            final URLClassLoader classLoader = new URLClassLoader( urls );
   
               //load class and retrieve appropriate main method.
               final Class clazz = classLoader.loadClass( "org.apache.myrmidon.Main" );
               final Method method = clazz.getMethod( "main", new Class[] { args.getClass()
} );
   
  +            Thread.currentThread().setContextClassLoader( classLoader );
  +
               //kick the tires and light the fires....
               method.invoke( null, new Object[] { args } );
           }
  @@ -80,6 +83,14 @@
   
               if( !file.isFile() || !file.canRead() )
               {
  +                //ignore non-files or unreadable files
  +                continue;
  +            }
  +
  +            final String name = file.getName();
  +            if( !name.endsWith( ".jar" ) && !name.endsWith( ".zip" ) )
  +            {
  +                //Ifnore files in lib dir that are not jars or zips
                   continue;
               }
   
  
  
  

Mime
View raw message