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-excalibur/src/scratchpad/org/apache/avalon/excalibur/extension PackageManager.java
Date Sat, 17 Nov 2001 01:01:40 GMT
donaldp     01/11/16 17:01:40

  Modified:    src/scratchpad/org/apache/avalon/excalibur/extension
                        PackageManager.java
  Log:
  Pass in available packages when scanning so that if a required Optional Package has a dependency
on an already available extension then this will not return a duplicate Optional Packages.
  
  Revision  Changes    Path
  1.3       +20 -13    jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/extension/PackageManager.java
  
  Index: PackageManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/extension/PackageManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PackageManager.java	2001/09/12 15:36:05	1.2
  +++ PackageManager.java	2001/11/17 01:01:40	1.3
  @@ -19,7 +19,7 @@
    * directories.
    *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
  - * @version $Revision: 1.2 $ $Date: 2001/09/12 15:36:05 $
  + * @version $Revision: 1.3 $ $Date: 2001/11/17 01:01:40 $
    * @see PackageRepository
    */
   public class PackageManager
  @@ -106,18 +106,20 @@
        * then it is added to list of dependencies. scanDependencies() is then recursively
        * called on all of the candidates required extensions.</p>
        *
  -     * @param extensions the array of required Extensions.
  +     * @param required the array of required Extensions.
  +     * @param available the array of Extensions already available to caller.
        * @param dependencies the list of dependencies.
        * @param unsatisfied the list of unsatisfied (ie non-local) dependencies.
        * @see #scanDependencies
        */
  -    public void scanDependencies( final Extension[] extensions, 
  +    public void scanDependencies( final Extension[] required, 
  +                                  final Extension[] available, 
                                     final List dependencies,
                                     final List unsatisfied )
       {
  -        for( int i = 0; i < extensions.length; i++ )
  +        for( int i = 0; i < required.length; i++ )
           {
  -            scanDependencies( extensions[ i ], dependencies, unsatisfied );
  +            scanDependencies( required[ i ], available, dependencies, unsatisfied );
           }
       }
   
  @@ -132,12 +134,14 @@
        * then it is added to list of dependencies. scanDependencies() is then recursively
        * called on all of the candidates required extensions.</p>
        *
  -     * @param extension the required Extension.
  +     * @param required the required Extension.
  +     * @param available the array of Extensions already available to caller.
        * @param dependencies the list of OptionalPackages required to satisfy extension.
        * @param unsatisfied the list of unsatisfied (ie non-local) dependencies.
        * @see #scanDependencies
        */
  -    public void scanDependencies( final Extension extension, 
  +    public void scanDependencies( final Extension required, 
  +                                  final Extension[] available,
                                     final List dependencies,
                                     final List unsatisfied )
       {
  @@ -147,18 +151,18 @@
           for( int i = 0; i < size; i++ )
           {
               final OptionalPackage optionalPackage = (OptionalPackage)dependencies.get(
i );
  -            if( optionalPackage.isCompatible( extension ) )
  +            if( optionalPackage.isCompatible( required ) )
               {
                   return;
               }
           }
   
  -        final OptionalPackage optionalPackage = getOptionalPackage( extension );
  +        final OptionalPackage optionalPackage = getOptionalPackage( required );
           if( null == optionalPackage )
           {
  -            if( !unsatisfied.contains( extension ) )
  +            if( !unsatisfied.contains( required ) )
               {
  -                unsatisfied.add( extension );
  +                unsatisfied.add( required );
               }
           }
           else
  @@ -167,8 +171,11 @@
               {
                   dependencies.add( optionalPackage );
               }
  -
  -            scanDependencies( optionalPackage.getRequiredExtensions(), dependencies, unsatisfied
);
  +            
  +            scanDependencies( optionalPackage.getRequiredExtensions(), 
  +                              available,
  +                              dependencies, 
  +                              unsatisfied );
           }
       }
   }
  
  
  

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