ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/file FileListUtil.java
Date Sun, 12 May 2002 12:57:54 GMT
adammurdoch    02/05/12 05:57:54

  Modified:    antlib/src/java/org/apache/antlib/runtime ImportTask.java
                        TypeLibTask.java
               container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/java/org/apache/myrmidon/components/library
                        DefaultLibraryManager.java
               container/src/java/org/apache/myrmidon/interfaces/library
                        LibraryManager.java
               container/src/test/org/apache/myrmidon/components
                        AbstractComponentTest.java
               container/src/test/org/apache/myrmidon/components/deployer/test
                        DefaultDeployerTestCase.java
               container/src/test/org/apache/myrmidon/components/library/test
                        DefaultLibraryManagerTestCase.java
               framework/src/java/org/apache/myrmidon/framework
                        AbstractTypeDef.java
               framework/src/java/org/apache/myrmidon/framework/file
                        FileListUtil.java
  Removed:     container/src/java/org/apache/myrmidon/components/library
                        DefaultTypeLibraryManager.java
               container/src/java/org/apache/myrmidon/interfaces/library
                        TypeLibraryManager.java
  Log:
  * Implemented LibraryManager.getLibrary( String ), which replaces
    TypeLibraryManager.getTypeLibrary().  Classloaders are now reused
    across <import> tasks (eg importing the same lib in multiple projects).
  
  * Added LibraryManager.getCoreLibraries().  The same classloaders
    are now used for implicit import, and explicit import with <import>.
  
  * Removed TypeLibraryManager, it is replaced by LibraryManager.
  
  Revision  Changes    Path
  1.2       +5 -6      jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/runtime/ImportTask.java
  
  Index: ImportTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/runtime/ImportTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ImportTask.java	12 May 2002 11:18:39 -0000	1.1
  +++ ImportTask.java	12 May 2002 12:57:54 -0000	1.2
  @@ -7,12 +7,11 @@
    */
   package org.apache.antlib.runtime;
   
  -import org.apache.antlib.runtime.AbstractTypeLibTask;
  -import org.apache.myrmidon.interfaces.library.Library;
  -import org.apache.myrmidon.interfaces.library.TypeLibraryManager;
  -import org.apache.myrmidon.api.TaskException;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  +import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.interfaces.library.Library;
  +import org.apache.myrmidon.interfaces.library.LibraryManager;
   
   /**
    * Task to import a typeLib.
  @@ -53,8 +52,8 @@
        */
       protected Library getLibrary() throws Exception
       {
  -        final TypeLibraryManager libraryManager = (TypeLibraryManager)getService( TypeLibraryManager.class
);
  -        final Library library = libraryManager.getTypeLibrary( m_library );
  +        final LibraryManager libraryManager = (LibraryManager)getService( LibraryManager.class
);
  +        final Library library = libraryManager.getLibrary( m_library );
           return library;
       }
   }
  
  
  
  1.2       +1 -1      jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/runtime/TypeLibTask.java
  
  Index: TypeLibTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/src/java/org/apache/antlib/runtime/TypeLibTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TypeLibTask.java	12 May 2002 11:18:39 -0000	1.1
  +++ TypeLibTask.java	12 May 2002 12:57:54 -0000	1.2
  @@ -53,6 +53,6 @@
       protected Library getLibrary() throws Exception
       {
           final LibraryManager libraryManager = (LibraryManager)getService( LibraryManager.class
);
  -        return libraryManager.createLibrary( null, new File[] { m_lib } );
  +        return libraryManager.createLibrary( new File[] { m_lib } );
       }
   }
  
  
  
  1.65      +5 -11     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- DefaultEmbeddor.java	12 May 2002 11:12:52 -0000	1.64
  +++ DefaultEmbeddor.java	12 May 2002 12:57:54 -0000	1.65
  @@ -7,11 +7,11 @@
    */
   package org.apache.myrmidon.components.embeddor;
   
  +import java.io.File;
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  -import java.io.File;
   import org.apache.aut.converter.Converter;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  @@ -32,7 +32,6 @@
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.components.property.DefaultPropertyStore;
  -import org.apache.myrmidon.interfaces.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.interfaces.builder.ProjectBuilder;
   import org.apache.myrmidon.interfaces.configurer.Configurer;
   import org.apache.myrmidon.interfaces.converter.ConverterRegistry;
  @@ -40,17 +39,17 @@
   import org.apache.myrmidon.interfaces.deployer.TypeLibraryDeployer;
   import org.apache.myrmidon.interfaces.embeddor.Embeddor;
   import org.apache.myrmidon.interfaces.event.TaskEventManager;
  +import org.apache.myrmidon.interfaces.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.interfaces.executor.ExecutionContainer;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.executor.Executor;
   import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
   import org.apache.myrmidon.interfaces.library.Library;
   import org.apache.myrmidon.interfaces.library.LibraryManager;
  -import org.apache.myrmidon.interfaces.library.TypeLibraryManager;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
  +import org.apache.myrmidon.interfaces.property.NameValidator;
   import org.apache.myrmidon.interfaces.property.PropertyResolver;
   import org.apache.myrmidon.interfaces.property.PropertyStore;
  -import org.apache.myrmidon.interfaces.property.NameValidator;
   import org.apache.myrmidon.interfaces.role.RoleManager;
   import org.apache.myrmidon.interfaces.role.RoleRegistry;
   import org.apache.myrmidon.interfaces.service.MultiSourceServiceManager;
  @@ -64,7 +63,7 @@
    * Instantiate this to embed inside other applications.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.64 $ $Date: 2002/05/12 11:12:52 $
  + * @version $Revision: 1.65 $ $Date: 2002/05/12 12:57:54 $
    */
   public class DefaultEmbeddor
       extends AbstractLogEnabled
  @@ -82,7 +81,6 @@
       private Deployer m_deployer;
       private TypeManager m_typeManager;
       private LibraryManager m_libraryManager;
  -    private TypeLibraryManager m_typeLibraryManager;
       private MultiSourceServiceManager m_workspaceServiceManager;
   
       private List m_components = new ArrayList();
  @@ -196,7 +194,6 @@
           m_deployer = (Deployer)m_serviceManager.lookup( Deployer.ROLE );
           m_typeManager = (TypeManager)m_serviceManager.lookup( TypeManager.ROLE );
           m_libraryManager = (LibraryManager)m_serviceManager.lookup( LibraryManager.ROLE
);
  -        m_typeLibraryManager = (TypeLibraryManager)m_serviceManager.lookup( TypeLibraryManager.ROLE
);
   
           // setup a service manager that creates the project services
           final ServiceManager projServiceManager
  @@ -221,7 +218,7 @@
           containerTypeDeployer.deployAll();
   
           // Deploy all core type libraries in the lib directory
  -        final Library[] coreLibs = m_typeLibraryManager.getCoreTypeLibraries();
  +        final Library[] coreLibs = m_libraryManager.getCoreLibraries();
           for( int i = 0; i < coreLibs.length; i++ )
           {
               final Library library = coreLibs[ i ];
  @@ -293,9 +290,6 @@
           createComponent( LibraryManager.ROLE,
                            LibraryManager.class,
                            PREFIX + "library.DefaultLibraryManager" );
  -        createComponent( TypeLibraryManager.ROLE,
  -                         TypeLibraryManager.class,
  -                         PREFIX + "library.DefaultTypeLibraryManager" );
           createComponent( Executor.ROLE,
                            Executor.class,
                            PREFIX + "executor.DefaultExecutor" );
  
  
  
  1.4       +139 -67   jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java
  
  Index: DefaultLibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultLibraryManager.java	10 May 2002 06:27:31 -0000	1.3
  +++ DefaultLibraryManager.java	12 May 2002 12:57:54 -0000	1.4
  @@ -29,6 +29,7 @@
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.activity.Initializable;
   import org.apache.myrmidon.interfaces.ComponentException;
   import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
   import org.apache.myrmidon.interfaces.library.Library;
  @@ -38,17 +39,19 @@
    * The default library manager implementation.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.3 $ $Date: 2002/05/10 06:27:31 $
  + * @version $Revision: 1.4 $ $Date: 2002/05/12 12:57:54 $
    */
   public class DefaultLibraryManager
  -    implements Serviceable, Contextualizable, LibraryManager
  +    implements Serviceable, Contextualizable, Initializable, LibraryManager
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultLibraryManager.class );
   
       private ExtensionManager m_extensionManager;
   
  +    private Library m_rootLibrary;
       private ClassLoader m_rootClassLoader;
  +    private Library[] m_coreLibraries;
   
       /**
        * Map from Jar file to the Library for that file.
  @@ -66,35 +69,70 @@
           m_extensionManager = (ExtensionManager)serviceManager.lookup( ExtensionManager.ROLE
);
       }
   
  +    public void initialize() throws Exception
  +    {
  +        m_rootLibrary = buildLibrary( "myrmidon.runtime", null, m_rootClassLoader );
  +    }
  +
  +    /**
  +     * Creates a library wrapper for a ClassLoader.
  +     */
  +    public Library createLibrary( ClassLoader classLoader ) throws Exception
  +    {
  +        return buildLibrary( null, null, classLoader );
  +    }
  +
       /**
  -     * Creates a library for a ClassLoader.
  +     * Returns the library for an extension.
        */
  -    public Library createLibrary( final ClassLoader classLoader )
  +    public Library getLibrary( final String libraryName )
           throws Exception
       {
  -        // Try to extract classpath from ClassLoader
  -        final ArrayList classPath = new ArrayList();
  -        for( ClassLoader loader = classLoader; loader != null; loader = loader.getParent()
)
  +        try
           {
  -            prependClassPath( loader, classPath );
  +            final Extension extension = new Extension( libraryName, null, null, null, null,
null, null );
  +            final OptionalPackage pkg = m_extensionManager.getOptionalPackage( extension
);
  +            if( pkg != null )
  +            {
  +                return buildLibrary( pkg, new HashSet() );
  +            }
  +        }
  +        catch( final Exception e )
  +        {
  +            final String message = REZ.getString( "load-library.error", libraryName );
  +            throw new ComponentException( message, e );
           }
  -        final URL[] libClassPath = (URL[])classPath.toArray( new URL[ classPath.size()
] );
   
  -        return new DefaultLibrary( null, null, classLoader, libClassPath );
  +        // Could not find the library
  +        final String message = REZ.getString( "no-library.error", libraryName );
  +        throw new Exception( message );
       }
   
       /**
  -     * Returns the library for an extension.
  +     * Returns the core type libraries.
        */
  -    public Library getLibrary( final String libName ) throws Exception
  +    public Library[] getCoreLibraries()
  +        throws Exception
       {
  -        throw new Exception( "not implemented" );
  +        if( m_coreLibraries == null )
  +        {
  +            final ArrayList libs = new ArrayList();
  +            final OptionalPackage[] corePackages = m_extensionManager.getCorePackages();
  +            for( int i = 0; i < corePackages.length; i++ )
  +            {
  +                final OptionalPackage pkg = corePackages[ i ];
  +                libs.add( buildLibrary( pkg, new HashSet() ) );
  +            }
  +            m_coreLibraries = (Library[])libs.toArray( new Library[ libs.size() ] );
  +        }
  +
  +        return m_coreLibraries;
       }
   
       /**
        * Creates a library for a set of files.
        */
  -    public Library createLibrary( final String name, final File[] files )
  +    public Library createLibrary( final File[] files )
           throws Exception
       {
           try
  @@ -107,14 +145,11 @@
                   packages[ i ] = toOptionalPackage( canonFile );
               }
   
  -            // Build the classloaders for the required extensions
  -            final ClassLoader[] parentClassLoaders = buildParentClassLoaders( packages,
new HashSet() );
  +            // Build the dependencies
  +            final Library[] parentLibraries = buildParentLibraries( packages, new HashSet()
);
   
  -            // Build the classloader
  -            final URL[] urls = toUrls( files );
  -            final ClassLoader classLoader = new MultiParentURLClassLoader( urls, parentClassLoaders
);
  -
  -            return new DefaultLibrary( name, null, classLoader, urls );
  +            // Build the library
  +            return buildLibrary( packages, parentLibraries );
           }
           catch( final Exception e )
           {
  @@ -125,20 +160,64 @@
       }
   
       /**
  -     * Builds the parent classloaders for a set of optional packages.  That is,
  -     * the classloaders for all of the extensions required by the given set
  -     * of optional packages.
  +     * Builds a library for a ClassLoader.
        */
  -    private ClassLoader[] buildParentClassLoaders( final OptionalPackage[] packages,
  -                                                   final Set pending )
  +    private Library buildLibrary( final String name,
  +                                  final Extension extension,
  +                                  final ClassLoader classLoader )
           throws Exception
       {
  -        final ArrayList classLoaders = new ArrayList();
  +        // Try to extract classpath from ClassLoader
  +        final ArrayList classPath = new ArrayList();
  +        for( ClassLoader loader = classLoader; loader != null; loader = loader.getParent()
)
  +        {
  +            prependClassPath( loader, classPath );
  +        }
  +        final URL[] libClassPath = (URL[])classPath.toArray( new URL[ classPath.size()
] );
  +        return new DefaultLibrary( name, extension, classLoader, libClassPath );
  +    }
   
  -        // Include the common class loader
  -        classLoaders.add( m_rootClassLoader );
  +    /**
  +     * Builds a library for a set of optional packages.
  +     */
  +    private Library buildLibrary( final OptionalPackage[] packages,
  +                                  final Library[] parentLibraries )
  +        throws Exception
  +    {
  +        final URL[] urls = new URL[ packages.length ];
  +        for( int i = 0; i < packages.length; i++ )
  +        {
  +            urls[ i ] = toUrl( packages[ i ].getFile() );
  +        }
  +        final ClassLoader[] parentClassLoaders = new ClassLoader[ parentLibraries.length
];
  +        for( int i = 0; i < parentLibraries.length; i++ )
  +        {
  +            parentClassLoaders[ i ] = parentLibraries[ i ].getClassLoader();
  +        }
  +        final ClassLoader classLoader = new MultiParentURLClassLoader( urls, parentClassLoaders
);
  +        final Extension[] extns = packages[ 0 ].getAvailableExtensions();
  +        String name = null;
  +        if( extns != null && extns.length > 0 )
  +        {
  +            name = extns[ 0 ].getExtensionName();
  +        }
  +        return new DefaultLibrary( name, null, classLoader, urls );
  +    }
  +
  +    /**
  +     * Builds the parent libraries for a set of optional packages.  That is,
  +     * the libraries for all of the extensions required by the optional packages.
  +     */
  +    private Library[] buildParentLibraries( final OptionalPackage[] packages,
  +                                            final Set pending )
  +        throws Exception
  +    {
  +        final ArrayList libs = new ArrayList();
   
  -        // Build the classloader for each optional package, filtering out duplicates
  +        // Include the common library
  +        libs.add( m_rootLibrary );
  +
  +        // Build the libraries for each optional package, filtering out duplicates
           for( int i = 0; i < packages.length; i++ )
           {
               final OptionalPackage optionalPackage = packages[ i ];
  @@ -146,35 +225,35 @@
               // Locate the dependencies for this jar file
               final OptionalPackage[] requiredPackages = getRequiredPackagesFor( optionalPackage
);
   
  -            // Build the classloader for the package
  +            // Build the library for the package
               for( int j = 0; j < requiredPackages.length; j++ )
               {
                   final OptionalPackage requiredPackage = requiredPackages[ j ];
  -                final ClassLoader classLoader = buildClassLoader( requiredPackage, pending
);
  -                if( !classLoaders.contains( classLoader ) )
  +                final Library library = buildLibrary( requiredPackage, pending );
  +                if( !libs.contains( library ) )
                   {
  -                    classLoaders.add( classLoader );
  +                    libs.add( library );
                   }
               }
           }
   
  -        return (ClassLoader[])classLoaders.toArray( new ClassLoader[ classLoaders.size()
] );
  +        return (Library[])libs.toArray( new Library[ libs.size() ] );
       }
   
       /**
  -     * Builds the classloader for an optional package.
  +     * Builds the library for an optional package.
        */
  -    private ClassLoader buildClassLoader( final OptionalPackage pkg,
  -                                          final Set pending )
  +    private Library buildLibrary( final OptionalPackage pkg,
  +                                  final Set pending )
           throws Exception
       {
           final File jarFile = pkg.getFile();
   
  -        // Check for cached classloader
  -        ClassLoader classLoader = (ClassLoader)m_classloaderMap.get( jarFile );
  -        if( classLoader != null )
  +        // Check for cached library
  +        Library library = (Library)m_classloaderMap.get( jarFile );
  +        if( library != null )
           {
  -            return classLoader;
  +            return library;
           }
   
           // Check for cyclic dependency
  @@ -185,17 +264,17 @@
           }
           pending.add( jarFile );
   
  -        // Build the classloaders for the extensions required by this optional
  +        // Build the libraries for the extensions required by this optional
           // package
  -        final ClassLoader[] parentClassLoaders =
  -            buildParentClassLoaders( new OptionalPackage[]{pkg}, pending );
  -
  -        // Create and cache the classloader
  -        final URL[] urls = {jarFile.toURL()};
  -        classLoader = new MultiParentURLClassLoader( urls, parentClassLoaders );
  -        m_classloaderMap.put( jarFile, classLoader );
  +        final OptionalPackage[] pkgArray = new OptionalPackage[]{pkg};
  +        final Library[] parentLibraries =
  +            buildParentLibraries( pkgArray, pending );
  +
  +        // Create and cache the library
  +        library = buildLibrary( pkgArray, parentLibraries );
  +        m_classloaderMap.put( jarFile, library );
           pending.remove( jarFile );
  -        return classLoader;
  +        return library;
       }
   
       /**
  @@ -227,7 +306,7 @@
       }
   
       /**
  -     * Prepends the classpath for a classloader.
  +     * Prepends the classpath for a classloader, to a list of URLs.
        */
       private void prependClassPath( final ClassLoader loader, final ArrayList classPathUrls
)
           throws Exception
  @@ -247,26 +326,19 @@
       }
   
       /**
  -     * Assembles a set of files into a URL classpath.
  +     * Returns the classpath URL for a file.
        */
  -    private URL[] toUrls( final File[] files )
  +    private URL toUrl( final File file )
           throws MalformedURLException
       {
  -        final URL[] urls = new URL[ files.length ];
  -        for( int i = 0; i < files.length; i++ )
  +        if( file.isDirectory() )
           {
  -            final File file = files[ i ];
  -            if( file.isDirectory() )
  -            {
  -                urls[i] = new URL( file.toURL() + "/" );
  -            }
  -            else
  -            {
  -                urls[ i ] = file.toURL();
  -            }
  +            return new URL( file.toURL() + "/" );
  +        }
  +        else
  +        {
  +            return file.toURL();
           }
  -
  -        return urls;
       }
   
       /**
  
  
  
  1.3       +8 -3      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/library/LibraryManager.java
  
  Index: LibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/library/LibraryManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LibraryManager.java	9 May 2002 07:54:32 -0000	1.2
  +++ LibraryManager.java	12 May 2002 12:57:54 -0000	1.3
  @@ -13,18 +13,23 @@
    * Manages a set of libraries.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.3 $ $Date: 2002/05/12 12:57:54 $
    */
   public interface LibraryManager
   {
       String ROLE = LibraryManager.class.getName();
   
       /**
  -     * Returns the library for an extension.
  +     * Locates a library by name.
        */
       Library getLibrary( String libName ) throws Exception;
   
       /**
  +     * Returns the core libraries.
  +     */
  +    Library[] getCoreLibraries() throws Exception;
  +
  +    /**
        * Creates a library wrapper for a ClassLoader.
        */
       Library createLibrary( ClassLoader classLoader ) throws Exception;
  @@ -40,5 +45,5 @@
        * classes can be shared across the libraries created by this library
        * manager.
        */
  -    Library createLibrary( String name, File[] files ) throws Exception;
  +    Library createLibrary( File[] files ) throws Exception;
   }
  
  
  
  1.36      +8 -14     jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java
  
  Index: AbstractComponentTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- AbstractComponentTest.java	11 May 2002 12:44:01 -0000	1.35
  +++ AbstractComponentTest.java	12 May 2002 12:57:54 -0000	1.36
  @@ -28,23 +28,24 @@
   import org.apache.myrmidon.components.configurer.DefaultConfigurer;
   import org.apache.myrmidon.components.converter.DefaultMasterConverter;
   import org.apache.myrmidon.components.deployer.DefaultDeployer;
  +import org.apache.myrmidon.components.event.DefaultTaskEventManager;
   import org.apache.myrmidon.components.executor.DefaultExecutor;
   import org.apache.myrmidon.components.extensions.DefaultExtensionManager;
  +import org.apache.myrmidon.components.library.DefaultLibraryManager;
   import org.apache.myrmidon.components.property.DefaultPropertyResolver;
  +import org.apache.myrmidon.components.property.DefaultPropertyStore;
   import org.apache.myrmidon.components.role.DefaultRoleManager;
   import org.apache.myrmidon.components.type.DefaultTypeManager;
  -import org.apache.myrmidon.components.event.DefaultTaskEventManager;
  -import org.apache.myrmidon.components.property.DefaultPropertyStore;
  -import org.apache.myrmidon.interfaces.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.components.workspace.DefaultTaskContext;
  -import org.apache.myrmidon.components.library.DefaultLibraryManager;
  -import org.apache.myrmidon.components.library.DefaultTypeLibraryManager;
   import org.apache.myrmidon.interfaces.configurer.Configurer;
   import org.apache.myrmidon.interfaces.converter.ConverterRegistry;
   import org.apache.myrmidon.interfaces.deployer.Deployer;
  -import org.apache.myrmidon.interfaces.executor.Executor;
  +import org.apache.myrmidon.interfaces.event.TaskEventManager;
  +import org.apache.myrmidon.interfaces.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  +import org.apache.myrmidon.interfaces.executor.Executor;
   import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
  +import org.apache.myrmidon.interfaces.library.LibraryManager;
   import org.apache.myrmidon.interfaces.property.PropertyResolver;
   import org.apache.myrmidon.interfaces.role.RoleInfo;
   import org.apache.myrmidon.interfaces.role.RoleManager;
  @@ -52,15 +53,12 @@
   import org.apache.myrmidon.interfaces.service.ServiceFactory;
   import org.apache.myrmidon.interfaces.type.DefaultTypeFactory;
   import org.apache.myrmidon.interfaces.type.TypeManager;
  -import org.apache.myrmidon.interfaces.event.TaskEventManager;
  -import org.apache.myrmidon.interfaces.library.LibraryManager;
  -import org.apache.myrmidon.interfaces.library.TypeLibraryManager;
   
   /**
    * A base class for tests for the default components.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.35 $ $Date: 2002/05/11 12:44:01 $
  + * @version $Revision: 1.36 $ $Date: 2002/05/12 12:57:54 $
    */
   public abstract class AbstractComponentTest
       extends AbstractContainerTestCase
  @@ -108,10 +106,6 @@
   
               component = createComponent( LibraryManager.ROLE, DefaultLibraryManager.class
);
               m_serviceManager.put( LibraryManager.ROLE, component );
  -            components.add( component );
  -
  -            component = createComponent( TypeLibraryManager.ROLE, DefaultTypeLibraryManager.class
);
  -            m_serviceManager.put( TypeLibraryManager.ROLE, component );
               components.add( component );
   
               component = createComponent( ExtensionManager.ROLE, DefaultExtensionManager.class
);
  
  
  
  1.9       +1 -1      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/deployer/test/DefaultDeployerTestCase.java
  
  Index: DefaultDeployerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/deployer/test/DefaultDeployerTestCase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultDeployerTestCase.java	9 May 2002 07:54:32 -0000	1.8
  +++ DefaultDeployerTestCase.java	12 May 2002 12:57:54 -0000	1.9
  @@ -79,7 +79,7 @@
       {
           final File file = getTestResource( "test.atl" );
           final LibraryManager libraryManager = (LibraryManager)getServiceManager().lookup(
LibraryManager.ROLE );
  -        final Library library = libraryManager.createLibrary( "test", new File[] { file
} );
  +        final Library library = libraryManager.createLibrary( new File[] { file } );
           return m_deployer.createDeployer( library, TEST_NAMESPACE );
       }
   
  
  
  
  1.3       +6 -6      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/library/test/DefaultLibraryManagerTestCase.java
  
  Index: DefaultLibraryManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/library/test/DefaultLibraryManagerTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultLibraryManagerTestCase.java	9 May 2002 07:54:32 -0000	1.2
  +++ DefaultLibraryManagerTestCase.java	12 May 2002 12:57:54 -0000	1.3
  @@ -22,7 +22,7 @@
    * Test cases for the DefaultClassLoaderManager.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.3 $ $Date: 2002/05/12 12:57:54 $
    */
   public class DefaultLibraryManagerTestCase
       extends AbstractComponentTest
  @@ -220,7 +220,7 @@
   
           // Build the classloader
           final File jarFile = getTestResource( "no-dependencies.jar" );
  -        final Library lib = m_libraryManager.createLibrary( null, new File[] { jarFile
} );
  +        final Library lib = m_libraryManager.createLibrary( new File[] { jarFile } );
           final ClassLoader classLoader = lib.getClassLoader();
   
           // Check shared classes/resources
  @@ -250,7 +250,7 @@
   
           // Build the Jar classloader
           final File jarFile = getTestResource( "one-dependency.jar" );
  -        final Library lib = m_libraryManager.createLibrary( null, new File[] { jarFile
} );
  +        final Library lib = m_libraryManager.createLibrary( new File[] { jarFile } );
           final ClassLoader classLoader = lib.getClassLoader();
   
           // Check shared classes/resources
  @@ -278,10 +278,10 @@
   
           // Build the Jar classloaders
           final File jarFile1 = getTestResource( "one-dependency.jar" );
  -        final Library lib1 = m_libraryManager.createLibrary( null, new File[] { jarFile1
} );
  +        final Library lib1 = m_libraryManager.createLibrary( new File[] { jarFile1 } );
           final ClassLoader classLoader1 = lib1.getClassLoader();
           final File jarFile2 = getTestResource( "one-dependency-2.jar" );
  -        final Library lib2 = m_libraryManager.createLibrary( null, new File[] { jarFile2
} );
  +        final Library lib2 = m_libraryManager.createLibrary( new File[] { jarFile2 } );
           final ClassLoader classLoader2 = lib2.getClassLoader();
   
           // Check extension classes/resources
  @@ -299,7 +299,7 @@
           final File jarFile = getTestResource( "ext/cycle-extension-1.jar" );
           try
           {
  -            m_libraryManager.createLibrary( null, new File[] { jarFile } );
  +            m_libraryManager.createLibrary( new File[] { jarFile } );
               fail();
           }
           catch( final Exception e )
  
  
  
  1.6       +2 -2      jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/AbstractTypeDef.java
  
  Index: AbstractTypeDef.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/AbstractTypeDef.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractTypeDef.java	9 May 2002 07:54:32 -0000	1.5
  +++ AbstractTypeDef.java	12 May 2002 12:57:54 -0000	1.6
  @@ -25,7 +25,7 @@
    * TODO: Make this support classpath sub-element in future
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.5 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.6 $ $Date: 2002/05/12 12:57:54 $
    */
   public abstract class AbstractTypeDef
       extends AbstractContainerTask
  @@ -83,7 +83,7 @@
           try
           {
               final LibraryManager libraryManager = (LibraryManager)getService( LibraryManager.class
);
  -            final Library library = libraryManager.createLibrary( null, classpath );
  +            final Library library = libraryManager.createLibrary( classpath );
               final Deployer deployer = (Deployer)getService( Deployer.class );
               final TypeLibraryDeployer typeDeployer = deployer.createDeployer( library,
m_namespace );
               final TypeDefinition typeDef = createTypeDefinition();
  
  
  
  1.5       +2 -2      jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/file/FileListUtil.java
  
  Index: FileListUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/file/FileListUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FileListUtil.java	9 May 2002 07:54:32 -0000	1.4
  +++ FileListUtil.java	12 May 2002 12:57:54 -0000	1.5
  @@ -21,7 +21,7 @@
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.4 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.5 $ $Date: 2002/05/12 12:57:54 $
    */
   public final class FileListUtil
   {
  @@ -91,7 +91,7 @@
           final LibraryManager manager = (LibraryManager)context.getService( LibraryManager.class
);
           try
           {
  -            final Library library = manager.createLibrary( null, files );
  +            final Library library = manager.createLibrary( files );
               return library.getClassLoader();
           }
           catch( final Exception e )
  
  
  

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


Mime
View raw message