akarasulu    2003/11/11 18:31:22

  Modified:    repository/impl/src/java/org/apache/avalon/repository/impl
                        DefaultFileRepository.java
  Log:
  Forgot to add the requested artifact to the 
  right ClassLoader tier.
  
  Revision  Changes    Path
  1.6       +30 -3     
avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultFileRepository.java
  
  Index: DefaultFileRepository.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/repository/impl/src/java/org/apache/avalon/repository/impl/DefaultFileRepository.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultFileRepository.java        11 Nov 2003 06:55:01 -0000      1.5
  +++ DefaultFileRepository.java        12 Nov 2003 02:31:22 -0000      1.6
  @@ -52,10 +52,11 @@
    
   
   import java.io.File ;
  +import java.util.ArrayList ;
  +
   import java.net.URL ;
   import java.net.Authenticator ;
  -import java.net.URLClassLoader;
  -import java.util.ArrayList;
  +import java.net.URLClassLoader ;
   
   import javax.naming.directory.Attributes ;
   
  @@ -311,6 +312,9 @@
           ArrayList l_others = new ArrayList() ;
           ArtifactDescriptor [] l_descriptors = getDependencies( a_descriptor ) ;
           
  +        /*
  +         * Add all the dependencies of the descriptor argument 
  +         */
           for ( int ii = 0; ii < l_descriptors.length; ii++ )
           {
               if ( "jars" != l_descriptors[ii].getType() )
  @@ -336,6 +340,29 @@
               }
           }
           
  +        /*
  +         * Add the descriptor argument itself 
  +         */
  +        if ( a_descriptor.getName().endsWith("api") )
  +        {
  +            l_apiJars.add( getArtifact( a_descriptor ) ) ;
  +        }
  +        else if ( a_descriptor.getName().endsWith("spi") )
  +        {
  +            l_spiJars.add( getArtifact( a_descriptor ) ) ;
  +        }
  +        else if ( a_descriptor.getName().endsWith("impl") )
  +        {
  +            l_implJars.add( getArtifact( a_descriptor ) ) ;
  +        }
  +        else
  +        {
  +            l_others.add( getArtifact( a_descriptor ) ) ;
  +        }
  +
  +        /*
  +         * Build the classloader tiers
  +         */
           ClassLoader l_topCL = ClassLoader.getSystemClassLoader() ;
           ClassLoader l_othersCL = new URLClassLoader( (URL []) 
                   l_others.toArray( new URL[0] ), l_topCL ) ;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to