You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/11/01 02:15:40 UTC

cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces ClassLoaderManager.java Installation.java

donaldp     2002/10/31 17:15:40

  Modified:    src/java/org/apache/avalon/phoenix/components/classloader
                        ContextClassLoaderManager.java
                        DefaultClassLoaderManager.java
               src/java/org/apache/avalon/phoenix/components/deployer
                        DefaultDeployer.java Resources.properties
               src/java/org/apache/avalon/phoenix/components/installer
                        DefaultInstaller.java
               src/java/org/apache/avalon/phoenix/interfaces
                        ClassLoaderManager.java Installation.java
  Log:
  Installer no longer builds classpath. It is now built up in ClassLoaderManager which means we can remove a whole bunch of cruft from perhistoric times.
  
  Revision  Changes    Path
  1.10      +1 -3      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/ContextClassLoaderManager.java
  
  Index: ContextClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/ContextClassLoaderManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ContextClassLoaderManager.java	6 Sep 2002 12:01:07 -0000	1.9
  +++ ContextClassLoaderManager.java	1 Nov 2002 01:15:40 -0000	1.10
  @@ -22,15 +22,13 @@
        *               or else the same as baseDirectory)
        * @param baseDirectory the base directory of application
        * @param workDirectory the work directory of application
  -     * @param classPath the list of URLs in applications deployment
        * @return the ContextClassLoader created
        * @throws Exception if an error occurs
        */
       public ClassLoader createClassLoader( final Configuration environment,
                                             final File source,
                                             final File baseDirectory,
  -                                          final File workDirectory,
  -                                          final String[] classPath )
  +                                          final File workDirectory )
           throws Exception
       {
           return Thread.currentThread().getContextClassLoader();
  
  
  
  1.48      +1 -3      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/DefaultClassLoaderManager.java
  
  Index: DefaultClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/classloader/DefaultClassLoaderManager.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- DefaultClassLoaderManager.java	1 Nov 2002 01:01:47 -0000	1.47
  +++ DefaultClassLoaderManager.java	1 Nov 2002 01:15:40 -0000	1.48
  @@ -139,15 +139,13 @@
        *               or else the same as baseDirectory)
        * @param homeDirectory the base directory of application
        * @param workDirectory the work directory of application
  -     * @param classPath the list of URLs in applications deployment
        * @return the ClassLoader created
        * @throws Exception if an error occurs
        */
       public ClassLoader createClassLoader( final Configuration environment,
                                             final File source,
                                             final File homeDirectory,
  -                                          final File workDirectory,
  -                                          final String[] classPath )
  +                                          final File workDirectory )
           throws Exception
       {
           //Configure policy
  
  
  
  1.60      +2 -5      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeployer.java
  
  Index: DefaultDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/DefaultDeployer.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- DefaultDeployer.java	28 Oct 2002 07:13:34 -0000	1.59
  +++ DefaultDeployer.java	1 Nov 2002 01:15:40 -0000	1.60
  @@ -10,7 +10,6 @@
   import java.io.File;
   import java.net.MalformedURLException;
   import java.net.URL;
  -import java.util.Arrays;
   import java.util.Hashtable;
   import java.util.Map;
   import java.util.Set;
  @@ -252,8 +251,7 @@
                   m_classLoaderManager.createClassLoader( environment,
                                                           installation.getSource(),
                                                           installation.getDirectory(),
  -                                                        installation.getWorkDirectory(),
  -                                                        installation.getClassPath() );
  +                                                        installation.getWorkDirectory() );
               //assemble all the blocks for application
               final SarMetaData metaData =
                   m_assembler.assembleSar( name, assembly, directory, classLoader );
  @@ -279,8 +277,7 @@
   
               final String message =
                   REZ.getString( "deploy.notice.sar.add",
  -                               metaData.getName(),
  -                               Arrays.asList( installation.getClassPath() ) );
  +                               metaData.getName() );
               getLogger().debug( message );
               success = true;
           }
  
  
  
  1.18      +1 -1      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/deployer/Resources.properties,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Resources.properties	21 Sep 2002 02:48:22 -0000	1.17
  +++ Resources.properties	1 Nov 2002 01:15:40 -0000	1.18
  @@ -1,4 +1,4 @@
  -deploy.notice.sar.add=Adding SarEntry named "{0}" to Kernel with ClassPath = {1}.
  +deploy.notice.sar.add=Adding SarEntry named "{0}" to Kernel.
   deploy.error.config.create=Error building configuration from {0}.
   deploy.error.sar.add=Error adding component entry ({0}) to container.
   deploy.error.deploy.failed=Failed to deploy {0} from {1}.
  
  
  
  1.11      +8 -25     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/installer/DefaultInstaller.java
  
  Index: DefaultInstaller.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/installer/DefaultInstaller.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultInstaller.java	2 Oct 2002 11:25:55 -0000	1.10
  +++ DefaultInstaller.java	1 Nov 2002 01:15:40 -0000	1.11
  @@ -14,7 +14,6 @@
   import java.io.OutputStream;
   import java.net.MalformedURLException;
   import java.net.URL;
  -import java.util.ArrayList;
   import java.util.Enumeration;
   import java.util.zip.ZipEntry;
   import java.util.zip.ZipFile;
  @@ -245,25 +244,20 @@
           //this directory is created?
           directory.mkdirs();
   
  -        final ArrayList jars = new ArrayList();
  -
           final File workDir = getRelativeWorkDir( name );
           boolean success = false;
           try
           {
  -            expandZipFile( zipFile, directory, workDir, jars, url );
  -            //Prepare and create Installation
  -            final String[] classPath =
  -                (String[]) jars.toArray( new String[ jars.size() ] );
  +            expandZipFile( zipFile, directory, workDir, url );
   
  +            //Prepare and create Installation
               final String assembly = getURLAsString( new File( directory, FS_ASSEMBLY_XML ) );
               final String config = getURLAsString( new File( directory, FS_CONFIG_XML ) );
               final String environment = getURLAsString( new File( directory, FS_ENV_XML ) );
   
               success = true;
               return new Installation( file, directory, workDir,
  -                                     config, assembly, environment,
  -                                     classPath );
  +                                     config, assembly, environment );
           }
           finally
           {
  @@ -281,14 +275,12 @@
        * @param directory the directory where to extract non-jar,
        *        non-classes files
        * @param workDir the directory to extract classes/jar files
  -     * @param classpath the list to add classpath entries to
        * @param url the url of deployment (for error reporting purposes)
        * @throws InstallationException if an error occurs extracting files
        */
       private void expandZipFile( final ZipFile zipFile,
                                   final File directory,
                                   final File workDir,
  -                                final ArrayList classpath,
                                   final URL url )
           throws InstallationException
       {
  @@ -311,13 +303,12 @@
               if( handleClasses( zipFile,
                                  entry,
                                  name,
  -                               workDir,
  -                               classpath ) )
  +                               workDir ) )
               {
                   continue;
               }
   
  -            if( handleJars( zipFile, entry, name, workDir, classpath ) )
  +            if( handleJars( zipFile, entry, name, workDir ) )
               {
                   continue;
               }
  @@ -361,23 +352,18 @@
        * @param entry the entry to extract
        * @param name the normalized name of entry
        * @param workDir the working directory to extract to
  -     * @param jars the classpath list
        * @return true if handled, false otherwise
        */
       private boolean handleJars( final ZipFile zipFile,
                                   final ZipEntry entry,
                                   final String name,
  -                                final File workDir,
  -                                final ArrayList jars )
  +                                final File workDir )
           throws InstallationException
       {
           if( name.startsWith( LIB )
               && name.endsWith( ".jar" )
               && LIB.length() == name.lastIndexOf( "/" ) )
           {
  -            final File jar = new File( workDir, name );
  -            jars.add( getURLAsString( jar ) );
  -
               final File file = new File( workDir, name );
               expandFile( zipFile, entry, file );
               return true;
  @@ -395,14 +381,12 @@
        * @param entry the entry to extract
        * @param name the normalized name of entry
        * @param workDir the working directory to extract to
  -     * @param jars the classpath list
        * @return true if handled, false otherwise
        */
       private boolean handleClasses( final ZipFile zipFile,
                                      final ZipEntry entry,
                                      final String name,
  -                                   final File workDir,
  -                                   final ArrayList jars )
  +                                   final File workDir )
           throws InstallationException
       {
           if( name.startsWith( CLASSES ) )
  @@ -410,7 +394,6 @@
               final File classDir = new File( workDir, FS_CLASSES );
               if( !classDir.exists() )
               {
  -                jars.add( getURLAsString( classDir ) );
                   final File file = new File( workDir, name );
                   expandFile( zipFile, entry, file );
               }
  
  
  
  1.15      +2 -2      jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/ClassLoaderManager.java
  
  Index: ClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/ClassLoaderManager.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ClassLoaderManager.java	6 Sep 2002 11:22:14 -0000	1.14
  +++ ClassLoaderManager.java	1 Nov 2002 01:15:40 -0000	1.15
  @@ -38,7 +38,7 @@
       ClassLoader createClassLoader( Configuration environment,
                                      File source,
                                      File baseDirectory,
  -                                   File workDirectory,
  -                                   String[] classPath )
  +                                   File workDirectory
  +                                   )
           throws Exception;
   }
  
  
  
  1.2       +2 -17     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/Installation.java
  
  Index: Installation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/interfaces/Installation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Installation.java	21 Sep 2002 02:36:03 -0000	1.1
  +++ Installation.java	1 Nov 2002 01:15:40 -0000	1.2
  @@ -38,16 +38,12 @@
       ///URL to application configuration data
       private final String m_environment;
   
  -    ///ClassPath for application
  -    private final String[] m_classPath;
  -
       public Installation( final File source,
                            final File directory,
                            final File workDirectory,
                            final String config,
                            final String assembly,
  -                         final String environment,
  -                         final String[] classPath )
  +                         final String environment )
       {
           m_source = source;
           m_directory = directory;
  @@ -55,7 +51,6 @@
           m_config = config;
           m_assembly = assembly;
           m_environment = environment;
  -        m_classPath = classPath;
       }
   
       /**
  @@ -118,15 +113,5 @@
       public String getEnvironment()
       {
           return m_environment;
  -    }
  -
  -    /**
  -     * Retrieve ClassPath for application.
  -     *
  -     * @return the classpath
  -     */
  -    public String[] getClassPath()
  -    {
  -        return m_classPath;
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>