avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped PipedTest.java
Date Thu, 25 Jul 2002 23:12:01 GMT
hammant     2002/07/25 16:12:01

  Modified:    altrmi/lib bcel.jar
               altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers
                        AbstractDynamicGeneratorClassRetriever.java
                        BcelDynamicGeneratorClassRetriever.java
                        JavacDynamicGeneratorClassRetriever.java
               altrmi/src/test/org/apache/excalibur/altrmi/test/piped
                        PipedTest.java
  Log:
  Rework of Dynamic Class retriever.  Update of BCEL from latest CVS version.
  
  Revision  Changes    Path
  1.2       +1885 -1231jakarta-avalon-excalibur/altrmi/lib/bcel.jar
  
  	<<Binary file>>
  
  
  1.3       +10 -7     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/AbstractDynamicGeneratorClassRetriever.java
  
  Index: AbstractDynamicGeneratorClassRetriever.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/AbstractDynamicGeneratorClassRetriever.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractDynamicGeneratorClassRetriever.java	15 Jul 2002 21:52:19 -0000	1.2
  +++ AbstractDynamicGeneratorClassRetriever.java	25 Jul 2002 23:12:01 -0000	1.3
  @@ -13,6 +13,7 @@
   import java.io.IOException;
   import java.net.URL;
   import org.apache.excalibur.altrmi.common.ProxyGenerator;
  +import org.apache.excalibur.altrmi.common.AbstractMethodHandler;
   import org.apache.excalibur.altrmi.server.AltrmiProxyGenerator;
   import org.apache.excalibur.altrmi.server.ClassRetrievalException;
   import org.apache.excalibur.altrmi.server.ClassRetriever;
  @@ -33,18 +34,20 @@
       private String m_altrmiClasspath;
       private String m_classGenDir;
       private String m_srcGenDir;
  -    private URL m_genJarURL;
       private Class m_generatorClass ;
   
       /**
        *
  -     * @param genJarURL the user of the generated jar file
  -     * @param generatorClass the class to use for generation.
  +     * @param classLoader the classloader in which the proxy generater will be found.
  +     * @param generatorClassName the name of teh proxy gen class
        */
  -    public AbstractDynamicGeneratorClassRetriever( URL genJarURL, Class generatorClass)
  +    public AbstractDynamicGeneratorClassRetriever(ClassLoader classLoader, String generatorClassName)
       {
  -        m_genJarURL = genJarURL;
  -        m_generatorClass = generatorClass;
  +        try {
  +            m_generatorClass = classLoader.loadClass(generatorClassName);
  +        } catch (ClassNotFoundException e) {
  +            throw new NoClassDefFoundError(generatorClassName);
  +        }
       }
   
       /**
  
  
  
  1.3       +15 -10    jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/BcelDynamicGeneratorClassRetriever.java
  
  Index: BcelDynamicGeneratorClassRetriever.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/BcelDynamicGeneratorClassRetriever.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BcelDynamicGeneratorClassRetriever.java	15 Jul 2002 21:52:19 -0000	1.2
  +++ BcelDynamicGeneratorClassRetriever.java	25 Jul 2002 23:12:01 -0000	1.3
  @@ -7,11 +7,6 @@
    */
   package org.apache.excalibur.altrmi.server.impl.classretrievers;
   
  -import org.apache.excalibur.altrmi.generator.BCELProxyGeneratorImpl;
  -
  -import java.net.URL;
  -
  -
   /**
    * Class BcelDynamicGeneratorClassRetriever
    *
  @@ -22,13 +17,23 @@
   public class BcelDynamicGeneratorClassRetriever extends AbstractDynamicGeneratorClassRetriever
   {
       /**
  -     * Contruct a Dynamic Class Generator with a URL for the generated Jar File.
  +     * Contruct a Dynamic Class Generator with a classloader pointing to the generator
classes.
  +     *
  +     * @param classLoader the classloader in which the proxy generater will be found.
  +     */
  +
  +    public BcelDynamicGeneratorClassRetriever(ClassLoader classLoader)
  +    {
  +        super(classLoader, "org.apache.excalibur.altrmi.generator.BCELProxyGeneratorImpl");
  +    }
  +
  +    /**
  +     * Contruct a Dynamic Class Generator using the classes own classloader.
        *
  -     * @param genJarURL a URL for the generated Jar File
        */
   
  -    public BcelDynamicGeneratorClassRetriever(URL genJarURL)
  +    public BcelDynamicGeneratorClassRetriever()
       {
  -        super(genJarURL, BCELProxyGeneratorImpl.class);
  +        super(BcelDynamicGeneratorClassRetriever.class.getClassLoader(), "org.apache.excalibur.altrmi.generator.BCELProxyGeneratorImpl");
       }
   }
  
  
  
  1.3       +16 -9     jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/JavacDynamicGeneratorClassRetriever.java
  
  Index: JavacDynamicGeneratorClassRetriever.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/java/org/apache/excalibur/altrmi/server/impl/classretrievers/JavacDynamicGeneratorClassRetriever.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JavacDynamicGeneratorClassRetriever.java	15 Jul 2002 21:52:19 -0000	1.2
  +++ JavacDynamicGeneratorClassRetriever.java	25 Jul 2002 23:12:01 -0000	1.3
  @@ -7,11 +7,6 @@
    */
   package org.apache.excalibur.altrmi.server.impl.classretrievers;
   
  -import org.apache.excalibur.altrmi.generator.ProxyGeneratorImpl;
  -
  -import java.net.URL;
  -
  -
   /**
    * Class JavacDynamicGeneratorClassRetriever
    *
  @@ -22,11 +17,23 @@
   public class JavacDynamicGeneratorClassRetriever extends AbstractDynamicGeneratorClassRetriever
   {
       /**
  +     * Contruct a Dynamic Class Generator with a classloader pointing to the generator
classes.
  +     *
  +     * @param classLoader the classloader in which the proxy generater will be found.
  +     */
  +
  +    public JavacDynamicGeneratorClassRetriever(ClassLoader classLoader)
  +    {
  +        super(classLoader, "org.apache.excalibur.altrmi.generator.ProxyGeneratorImpl");
  +    }
  +
  +    /**
  +     * Contruct a Dynamic Class Generator using the classes own classloader.
        *
  -     * @param genJarURL the url of the generated jar file.
        */
  -    public JavacDynamicGeneratorClassRetriever(URL genJarURL)
  +
  +    public JavacDynamicGeneratorClassRetriever()
       {
  -        super(genJarURL, ProxyGeneratorImpl.class);
  +        super(JavacDynamicGeneratorClassRetriever.class.getClassLoader(), "org.apache.excalibur.altrmi.generator.ProxyGeneratorImpl");
       }
   }
  
  
  
  1.5       +11 -3     jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped/PipedTest.java
  
  Index: PipedTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/piped/PipedTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PipedTest.java	14 Jul 2002 23:12:44 -0000	1.4
  +++ PipedTest.java	25 Jul 2002 23:12:01 -0000	1.5
  @@ -9,6 +9,8 @@
   
   import java.io.File;
   import java.net.MalformedURLException;
  +import java.net.URLClassLoader;
  +import java.net.URL;
   
   import org.apache.excalibur.altrmi.server.*;
   import org.apache.excalibur.altrmi.server.impl.classretrievers.*;
  @@ -42,8 +44,14 @@
           else if( serverOrClientFactory.equals( "D" ) )
           {
               AbstractDynamicGeneratorClassRetriever dr =
  -                new BcelDynamicGeneratorClassRetriever( new File( "build" + File.separator
  -                                                              + "classes" ).toURL() );
  +                new BcelDynamicGeneratorClassRetriever(
  +                    new URLClassLoader(
  +                        new URL[] {
  +                            new File( "build" + File.separator + "classes" ).toURL()
  +                        }
  +                    )
  +                );
  +
               File source = new File( "testSource" );
   
               source.mkdir();
  
  
  

--
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