avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon/util/defaults/src/java/org/apache/avalon/util/defaults DefaultsBuilder.java
Date Thu, 19 Feb 2004 08:58:05 GMT
mcconnell    2004/02/19 00:58:05

  Modified:    logging/logkit/test/src/test/org/apache/avalon/logging/logkit/test
                        LoggingManagerHelper.java
               logging  maven.xml
               logging/site/xdocs/impl/logkit navigation.xml
               logging/site/xdocs/impl navigation.xml
               logging/site/xdocs navigation.xml
               merlin/activation/csi/src/java/org/apache/avalon/activation/csi
                        SecureRuntime.java
               merlin/activation/csi/src/test/org/apache/avalon/activation/csi
                        AbstractTestCase.java SystemContextBuilder.java
               merlin/activation/impl/src/java/org/apache/avalon/activation/impl
                        DefaultRuntime.java
               merlin/activation/impl/src/test/org/apache/avalon/activation/impl/test
                        AbstractTestCase.java SystemContextBuilder.java
               merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl
                        DefaultSystemContext.java
               merlin/composition/impl/src/test/org/apache/avalon/composition/model/test
                        AbstractTestCase.java SystemContextBuilder.java
               merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl
                        DefaultFactory.java
               merlin   maven.xml
               meta     maven.xml
               util/defaults/src/java/org/apache/avalon/util/defaults
                        DefaultsBuilder.java
  Log:
  Synchronize with repository spi updates.
  
  Revision  Changes    Path
  1.2       +6 -6      avalon/logging/logkit/test/src/test/org/apache/avalon/logging/logkit/test/LoggingManagerHelper.java
  
  Index: LoggingManagerHelper.java
  ===================================================================
  RCS file: /home/cvs/avalon/logging/logkit/test/src/test/org/apache/avalon/logging/logkit/test/LoggingManagerHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LoggingManagerHelper.java	4 Feb 2004 20:49:13 -0000	1.1
  +++ LoggingManagerHelper.java	19 Feb 2004 08:58:03 -0000	1.2
  @@ -31,7 +31,7 @@
   import org.apache.avalon.repository.provider.Factory;
   import org.apache.avalon.repository.provider.InitialContext;
   import org.apache.avalon.repository.provider.Builder;
  -import org.apache.avalon.repository.main.DefaultInitialContext;
  +import org.apache.avalon.repository.main.DefaultInitialContextFactory;
   import org.apache.avalon.repository.main.DefaultBuilder;
   
   import org.apache.avalon.util.env.Env;
  @@ -58,9 +58,10 @@
        */
       public static LoggingManager setUpLoggingManager( String filename ) throws Exception
       {
  -        InitialContext context = 
  -          new DefaultInitialContext( 
  -            getMavenRepositoryDirectory() );
  +        DefaultInitialContextFactory initial = 
  +           new DefaultInitialContextFactory( "avalon", getBaseDir() );
  +        initial.setCacheDirectory( getMavenRepositoryDirectory() );
  +        InitialContext context = initial.createInitialContext();
   
           //
           // FIX ME - remove hard reference (get from a property)
  @@ -83,7 +84,6 @@
           File conf = new File( basedir, "conf" );
           File file = new File( conf, filename );
   
  -        //criteria.put( "avalon.logging.bootstrap", "debug" );
           criteria.put( "avalon.logging.configuration", file );
           criteria.put( "avalon.logging.basedir", target );
   
  
  
  
  1.3       +1 -1      avalon/logging/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/maven.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- maven.xml	14 Feb 2004 03:50:12 -0000	1.2
  +++ maven.xml	19 Feb 2004 08:58:03 -0000	1.3
  @@ -154,7 +154,7 @@
       <j:choose>
         <j:when test="${avalon.snapshot}">
           <maven:snapshot project="${pom}"/>
  -        <j:set var="timestamp" value="${snapshotSignature.substring(18)}"/>
  +        <j:set var="timestamp" value="${snapshotSignature.substring(15)}"/>
           <j:set var="binary.name" value="${maven.final.name}-${timestamp}-dist"/>
           <j:set var="source.name" value="${maven.final.name}-${timestamp}-src"/>
           <echo>Snapshot Packaging: ${timestamp}</echo>
  
  
  
  1.3       +2 -1      avalon/logging/site/xdocs/impl/logkit/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/site/xdocs/impl/logkit/navigation.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- navigation.xml	13 Feb 2004 10:25:45 -0000	1.2
  +++ navigation.xml	19 Feb 2004 08:58:03 -0000	1.3
  @@ -33,7 +33,7 @@
   
       <menu name="About Avalon Logging">
         <item name="Overview" href="/about/index.html"/>
  -      <item name="Specification" href="/api/index.html"/>
  +      <item name="Specification" href="/spec/index.html"/>
         <item name="Implementations" href="/impl/index.html">
           <item name="LogKit" href="/impl/logkit/index.html"/>
         </item>
  @@ -45,6 +45,7 @@
       </menu>
   
       <menu name="Related Projects">
  +      <item name="Merlin" href="http://avalon.apache.org/merlin"/>
         <item name="Repository" href="http://avalon.apache.org/repository"/>
         <item name="Utilities" href="http://avalon.apache.org/util"/>
       </menu>
  
  
  
  1.4       +1 -0      avalon/logging/site/xdocs/impl/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/site/xdocs/impl/navigation.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- navigation.xml	14 Feb 2004 03:50:12 -0000	1.3
  +++ navigation.xml	19 Feb 2004 08:58:04 -0000	1.4
  @@ -45,6 +45,7 @@
       </menu>
   
       <menu name="Related Projects">
  +      <item name="Merlin" href="http://avalon.apache.org/merlin"/>
         <item name="Repository" href="http://avalon.apache.org/repository"/>
         <item name="Utilities" href="http://avalon.apache.org/util"/>
       </menu>
  
  
  
  1.4       +1 -0      avalon/logging/site/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon/logging/site/xdocs/navigation.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- navigation.xml	14 Feb 2004 03:50:12 -0000	1.3
  +++ navigation.xml	19 Feb 2004 08:58:04 -0000	1.4
  @@ -43,6 +43,7 @@
       </menu>
   
       <menu name="Related Projects">
  +      <item name="Merlin" href="http://avalon.apache.org/merlin"/>
         <item name="Repository" href="http://avalon.apache.org/repository"/>
         <item name="Utilities" href="http://avalon.apache.org/util"/>
       </menu>
  
  
  
  1.2       +1 -8      avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureRuntime.java
  
  Index: SecureRuntime.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/csi/src/java/org/apache/avalon/activation/csi/SecureRuntime.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SecureRuntime.java	10 Feb 2004 16:14:15 -0000	1.1
  +++ SecureRuntime.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -32,13 +32,6 @@
   import org.apache.avalon.logging.provider.LoggingManager;
   import org.apache.avalon.logging.data.CategoryDirective;
   
  -import org.apache.avalon.repository.Artifact;
  -import org.apache.avalon.repository.Repository;
  -import org.apache.avalon.repository.provider.CacheManager;
  -import org.apache.avalon.repository.provider.InitialContext;
  -import org.apache.avalon.repository.provider.Builder;
  -import org.apache.avalon.repository.provider.Factory;
  -
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.ConsoleLogger;
   import org.apache.avalon.framework.context.DefaultContext;
  
  
  
  1.2       +6 -3      avalon/merlin/activation/csi/src/test/org/apache/avalon/activation/csi/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/csi/src/test/org/apache/avalon/activation/csi/AbstractTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractTestCase.java	10 Feb 2004 16:14:23 -0000	1.1
  +++ AbstractTestCase.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -37,7 +37,8 @@
   import org.apache.avalon.framework.parameters.Parameters;
   
   import org.apache.avalon.repository.provider.InitialContext;
  -import org.apache.avalon.repository.main.DefaultInitialContext;
  +import org.apache.avalon.repository.provider.InitialContextFactory;
  +import org.apache.avalon.repository.main.DefaultInitialContextFactory;
   
   import org.apache.avalon.util.exception.ExceptionHelper;
   import org.apache.avalon.util.env.Env;
  @@ -108,8 +109,10 @@
       */
       public void setUp( File base, File block ) throws Exception
       {
  -        InitialContext context = 
  -          new DefaultInitialContext( getMavenRepositoryDirectory() );
  +        InitialContextFactory initial = 
  +          new DefaultInitialContextFactory( "test", base );
  +        initial.setCacheDirectory( getMavenRepositoryDirectory() );
  +        InitialContext context = initial.createInitialContext();
     
           long timeout = 3000;
           File local = new File( base, "repository" );
  
  
  
  1.2       +8 -16     avalon/merlin/activation/csi/src/test/org/apache/avalon/activation/csi/SystemContextBuilder.java
  
  Index: SystemContextBuilder.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/csi/src/test/org/apache/avalon/activation/csi/SystemContextBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SystemContextBuilder.java	10 Feb 2004 16:14:23 -0000	1.1
  +++ SystemContextBuilder.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -34,7 +34,7 @@
   
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.Repository;
  -import org.apache.avalon.repository.provider.CacheManager;
  +import org.apache.avalon.repository.provider.RepositoryCriteria;
   import org.apache.avalon.repository.provider.InitialContext;
   import org.apache.avalon.repository.provider.Builder;
   import org.apache.avalon.repository.provider.Factory;
  @@ -86,8 +86,7 @@
             createLoggingManager( context, artifact, base, priority );
   
           Logger logger = logging.getLoggerForCategory( "" );
  -        CacheManager cache = createCacheManager( context, root );
  -        Repository repository = cache.createRepository();
  +        Repository repository = createTestRepository( context, root );
   
           final File home = new File( base, "home" );
           final File temp = new File( base, "temp" );
  @@ -100,20 +99,13 @@
             false, deploymenttimeout, secure );
       }
   
  -    private static CacheManager createCacheManager( 
  -      InitialContext context, File root ) 
  -      throws Exception
  +    private static Repository createTestRepository( InitialContext context, File cache
) throws Exception
       {
  -        String dpml = "http://dpml.net";
  -        String ibiblio = "http://www.ibiblio.org/maven";
  -        String[] hosts = new String[]{ dpml, ibiblio };
  -
           Factory factory = context.getInitialFactory();
  -        Map criteria = factory.createDefaultCriteria();
  -        criteria.put( "avalon.repository.cache", root );
  -        criteria.put( "avalon.repository.hosts", hosts );
  -
  -        return (CacheManager) factory.create( criteria );
  +        RepositoryCriteria criteria = (RepositoryCriteria) factory.createDefaultCriteria();
  +        criteria.setCacheDirectory( cache );
  +        criteria.setHosts( new String[0] );
  +        return (Repository) factory.create( criteria );
       }
   
       private static LoggingManager createLoggingManager( 
  
  
  
  1.2       +1 -8      avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/DefaultRuntime.java
  
  Index: DefaultRuntime.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/java/org/apache/avalon/activation/impl/DefaultRuntime.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultRuntime.java	10 Feb 2004 16:19:15 -0000	1.1
  +++ DefaultRuntime.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -32,13 +32,6 @@
   import org.apache.avalon.logging.provider.LoggingManager;
   import org.apache.avalon.logging.data.CategoryDirective;
   
  -import org.apache.avalon.repository.Artifact;
  -import org.apache.avalon.repository.Repository;
  -import org.apache.avalon.repository.provider.CacheManager;
  -import org.apache.avalon.repository.provider.InitialContext;
  -import org.apache.avalon.repository.provider.Builder;
  -import org.apache.avalon.repository.provider.Factory;
  -
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.ConsoleLogger;
   import org.apache.avalon.framework.context.DefaultContext;
  
  
  
  1.2       +8 -4      avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/impl/test/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/impl/test/AbstractTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractTestCase.java	10 Feb 2004 16:19:16 -0000	1.1
  +++ AbstractTestCase.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -36,7 +36,8 @@
   import org.apache.avalon.framework.parameters.Parameters;
   
   import org.apache.avalon.repository.provider.InitialContext;
  -import org.apache.avalon.repository.main.DefaultInitialContext;
  +import org.apache.avalon.repository.provider.InitialContextFactory;
  +import org.apache.avalon.repository.main.DefaultInitialContextFactory;
   
   import org.apache.avalon.util.exception.ExceptionHelper;
   import org.apache.avalon.util.env.Env;
  @@ -107,9 +108,12 @@
       */
       public void setUp( File base, File block ) throws Exception
       {
  -        InitialContext context = 
  -          new DefaultInitialContext( getMavenRepositoryDirectory() );
  -  
  +
  +        InitialContextFactory initial = 
  +          new DefaultInitialContextFactory( "test", base );
  +        initial.setCacheDirectory( getMavenRepositoryDirectory() );
  +        InitialContext context = initial.createInitialContext();
  +
           long timeout = 3000;
           File local = new File( base, "repository" );
   
  
  
  
  1.2       +8 -17     avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/impl/test/SystemContextBuilder.java
  
  Index: SystemContextBuilder.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/activation/impl/src/test/org/apache/avalon/activation/impl/test/SystemContextBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SystemContextBuilder.java	10 Feb 2004 16:19:16 -0000	1.1
  +++ SystemContextBuilder.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -33,7 +33,7 @@
   
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.Repository;
  -import org.apache.avalon.repository.provider.CacheManager;
  +import org.apache.avalon.repository.provider.RepositoryCriteria;
   import org.apache.avalon.repository.provider.InitialContext;
   import org.apache.avalon.repository.provider.Builder;
   import org.apache.avalon.repository.provider.Factory;
  @@ -83,10 +83,8 @@
   
           LoggingManager logging = 
             createLoggingManager( context, artifact, base, priority );
  -
           Logger logger = logging.getLoggerForCategory( "" );
  -        CacheManager cache = createCacheManager( context, root );
  -        Repository repository = cache.createRepository();
  +        Repository repository = createTestRepository( context, root );
   
           final File home = new File( base, "home" );
           final File temp = new File( base, "temp" );
  @@ -98,20 +96,13 @@
             false, deploymenttimeout, secure );
       }
   
  -    private static CacheManager createCacheManager( 
  -      InitialContext context, File root ) 
  -      throws Exception
  +    private static Repository createTestRepository( InitialContext context, File cache
) throws Exception
       {
  -        String dpml = "http://dpml.net";
  -        String ibiblio = "http://www.ibiblio.org/maven";
  -        String[] hosts = new String[]{ dpml, ibiblio };
  -
           Factory factory = context.getInitialFactory();
  -        Map criteria = factory.createDefaultCriteria();
  -        criteria.put( "avalon.repository.cache", root );
  -        criteria.put( "avalon.repository.hosts", hosts );
  -
  -        return (CacheManager) factory.create( criteria );
  +        RepositoryCriteria criteria = (RepositoryCriteria) factory.createDefaultCriteria();
  +        criteria.setCacheDirectory( cache );
  +        criteria.setHosts( new String[0] );
  +        return (Repository) factory.create( criteria );
       }
   
       private static LoggingManager createLoggingManager( 
  
  
  
  1.19      +1 -2      avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java
  
  Index: DefaultSystemContext.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/java/org/apache/avalon/composition/model/impl/DefaultSystemContext.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- DefaultSystemContext.java	14 Feb 2004 21:33:56 -0000	1.18
  +++ DefaultSystemContext.java	19 Feb 2004 08:58:04 -0000	1.19
  @@ -37,7 +37,6 @@
   
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.Repository;
  -import org.apache.avalon.repository.provider.CacheManager;
   import org.apache.avalon.repository.provider.InitialContext;
   import org.apache.avalon.repository.provider.Builder;
   import org.apache.avalon.repository.provider.Factory;
  
  
  
  1.2       +6 -9      avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/AbstractTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractTestCase.java	10 Feb 2004 16:24:48 -0000	1.1
  +++ AbstractTestCase.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -13,7 +13,8 @@
   import org.apache.avalon.composition.provider.ModelFactory;
   
   import org.apache.avalon.repository.provider.InitialContext;
  -import org.apache.avalon.repository.main.DefaultInitialContext;
  +import org.apache.avalon.repository.provider.InitialContextFactory;
  +import org.apache.avalon.repository.main.DefaultInitialContextFactory;
   
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.ConsoleLogger;
  @@ -71,14 +72,10 @@
               File confDir = new File( base, "conf" );
               File source = new File( confDir, m_path );
   
  -            //
  -            // FIXME - need to read the current version for a 
  -            // properties file or something
  -            //
  -
  -            InitialContext context = 
  -              new DefaultInitialContext( 
  -                getMavenRepositoryDirectory() );
  +            InitialContextFactory initial = 
  +              new DefaultInitialContextFactory( "test", base );
  +            initial.setCacheDirectory( getMavenRepositoryDirectory() );
  +            InitialContext context = initial.createInitialContext();
   
               try
               {
  
  
  
  1.2       +8 -17     avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/SystemContextBuilder.java
  
  Index: SystemContextBuilder.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/composition/impl/src/test/org/apache/avalon/composition/model/test/SystemContextBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SystemContextBuilder.java	10 Feb 2004 16:24:48 -0000	1.1
  +++ SystemContextBuilder.java	19 Feb 2004 08:58:04 -0000	1.2
  @@ -31,7 +31,7 @@
   
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.Repository;
  -import org.apache.avalon.repository.provider.CacheManager;
  +import org.apache.avalon.repository.provider.RepositoryCriteria;
   import org.apache.avalon.repository.provider.InitialContext;
   import org.apache.avalon.repository.provider.Builder;
   import org.apache.avalon.repository.provider.Factory;
  @@ -81,10 +81,8 @@
   
           LoggingManager logging = 
             createLoggingManager( context, artifact, base, priority );
  -
           Logger logger = logging.getLoggerForCategory( "" );
  -        CacheManager cache = createCacheManager( context, root );
  -        Repository repository = cache.createRepository();
  +        Repository repository = createTestRepository( context, root );
   
           final File home = new File( base, "home" );
           final File temp = new File( base, "temp" );
  @@ -94,20 +92,13 @@
             false, timeout, secure );
       }
   
  -    private static CacheManager createCacheManager( 
  -      InitialContext context, File root ) 
  -      throws Exception
  +    private static Repository createTestRepository( InitialContext context, File cache
) throws Exception
       {
  -        String dpml = "http://dpml.net";
  -        String ibiblio = "http://www.ibiblio.org/maven";
  -        String[] hosts = new String[]{ dpml, ibiblio };
  -
           Factory factory = context.getInitialFactory();
  -        Map criteria = factory.createDefaultCriteria();
  -        criteria.put( "avalon.repository.cache", root );
  -        criteria.put( "avalon.repository.hosts", hosts );
  -
  -        return (CacheManager) factory.create( criteria );
  +        RepositoryCriteria criteria = (RepositoryCriteria) factory.createDefaultCriteria();
  +        criteria.setCacheDirectory( cache );
  +        criteria.setHosts( new String[0] );
  +        return (Repository) factory.create( criteria );
       }
   
       private static LoggingManager createLoggingManager( 
  
  
  
  1.31      +18 -80    avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java
  
  Index: DefaultFactory.java
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/kernel/impl/src/java/org/apache/avalon/merlin/impl/DefaultFactory.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- DefaultFactory.java	14 Feb 2004 21:33:56 -0000	1.30
  +++ DefaultFactory.java	19 Feb 2004 08:58:05 -0000	1.31
  @@ -72,7 +72,7 @@
   import org.apache.avalon.repository.Artifact;
   import org.apache.avalon.repository.Repository;
   import org.apache.avalon.repository.provider.Builder;
  -import org.apache.avalon.repository.provider.CacheManager;
  +import org.apache.avalon.repository.provider.RepositoryCriteria;
   import org.apache.avalon.repository.provider.InitialContext;
   import org.apache.avalon.repository.provider.Factory;
   
  @@ -392,9 +392,13 @@
   
           Configuration repositoryConfig = 
             config.getChild( "repository" );
  -        CacheManager cache = 
  -          createCacheManager( context, criteria, hosts, config );
  -        Repository repository = cache.createRepository();
  +
  +        File root = criteria.getRepositoryDirectory();
  +        File cache = getCacheDirectory( root, repositoryConfig.getChild( "cache" ) );
  +
  +        Repository repository = 
  +          createApplicationRepository( context, cache, hosts );
  +
           getLogger().debug( 
             "repository established: " + repository );
   
  @@ -493,92 +497,26 @@
       * Utility method to create the application repository.
       * @param context the initial context
       * @param criteria the supplied factory criteria
  -    * @param config the repositotry configuration element
  +    * @param hosts the declared hosts
       * @return the repository
       */
  -    private CacheManager createCacheManager( 
  -      InitialContext context, KernelCriteria criteria, 
  -      String[] hosts, Configuration config )
  -      throws KernelException
  -    {
  -        File root = criteria.getRepositoryDirectory();
  -        File cache = getCacheDirectory( root, config.getChild( "cache" ) );
  -        Configuration proxy = config.getChild( "proxy", false );
  -        CacheManager manager = 
  -          createCacheManager( context, cache, hosts, proxy );
  -        return manager;
  -    }
  -
  -    private CacheManager createCacheManager( 
  -      InitialContext context, File cache, String[] hosts, 
  -      Configuration proxyConfig ) 
  +    private Repository createApplicationRepository( 
  +      InitialContext context, File cache, String[] hosts )
         throws KernelException
       {
  -        //
  -        // the supplied root argument is the root cache resolved relative
  -        // to system properties and environment variables.  This value is 
  -        // overriden if a cache is declared in the kernel repository 
  -        // configuration
  -        //
  -
           try
           {
               Factory factory = context.getInitialFactory();
  -            Map criteria = factory.createDefaultCriteria();
  -            criteria.put( "avalon.repository.cache", cache );
  -            criteria.put( "avalon.repository.hosts", hosts );
  -
  -            if( null != proxyConfig )
  -            {
  -                final String host = 
  -                  proxyConfig.getChild( "host" ).getValue( null );
  -                criteria.put( "avalon.repository.proxy.host", host );
  -
  -                final int port = 
  -                  proxyConfig.getChild( "port" ).getValueAsInteger( 0 );
  -                criteria.put( "avalon.repository.proxy.port", new Integer( port ) );
  -
  -                Configuration credentials = 
  -                  proxyConfig.getChild( "credentials", false );
  -                if( credentials != null )
  -                {
  -                    final String username = 
  -                      credentials.getChild( "username" ).getValue( null );
  -                    if( username == null )
  -                    {
  -                        final String error =
  -    "Credentials configuration does not contain the required 'username' element."
  -                          + ConfigurationUtil.list( credentials );
  -                        throw new KernelException( error );                
  -                    }
  -                    else
  -                    {
  -                        criteria.put( "avalon.repository.proxy.username", username );
  -                    }
  -
  -                    final String password = 
  -                        credentials.getChild( "password" ).getValue( null );
  -                    if( password == null )
  -                    {
  -                        final String error =
  -     "Credentials configuration does not contain the required 'password' element."
  -                          + ConfigurationUtil.list( credentials );
  -                        throw new KernelException( error );                
  -                    }
  -                    else
  -                    {
  -                        criteria.put( "avalon.repository.proxy.password", password );
  -                    }
  -                }
  -            }
  -
  -            return (CacheManager) factory.create( criteria );
  +            RepositoryCriteria criteria = 
  +              (RepositoryCriteria) factory.createDefaultCriteria();
  +            criteria.setCacheDirectory( cache );
  +            criteria.setHosts( hosts );
  +            return (Repository) factory.create( criteria );
           }
  -        catch ( Throwable e )
  +        catch( Throwable e )
           {
               final String error = 
  -              "Internal error while attempting to create the common repository "
  -              + " using the supplied cache: [" + cache + "].";
  +              "Cannot create application repository.";
               throw new KernelException( error, e );
           }
       }
  
  
  
  1.53      +2 -2      avalon/merlin/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon/merlin/maven.xml,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- maven.xml	18 Feb 2004 00:22:54 -0000	1.52
  +++ maven.xml	19 Feb 2004 08:58:05 -0000	1.53
  @@ -85,7 +85,7 @@
     -->
   
     <goal name="avalon:build" description="Build Merlin."
  -    prereqs="avalon:build-main,avalon:build-kernel,avalon:build-plugin,avalon:build-facilities,avalon:build-externals"/>
  +    prereqs="avalon:build-main,avalon:build-kernel,avalon:build-plugin,avalon:build-externals"/>
   
     <goal name="avalon:build-main" description="Build Merlin.">
       <maven:reactor basedir="${basedir}"
  @@ -217,7 +217,7 @@
          toDir="${maven.build.dir}/merlin/plugins"/>
     </goal>
   
  -  <goal name="avalon:build-facilities" description="Build Facilities.">
  +  <goal name="avalon:facilities" description="Build Facilities.">
       <maven:reactor basedir="${basedir}"
         includes="facilities/**/project.xml"
         excludes="facilities/*/project.xml"
  
  
  
  1.13      +94 -22    avalon/meta/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/avalon/meta/maven.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- maven.xml	10 Feb 2004 16:30:15 -0000	1.12
  +++ maven.xml	19 Feb 2004 08:58:05 -0000	1.13
  @@ -1,10 +1,18 @@
   <project default="avalon:build"  xmlns:maven="jelly:maven" xmlns:j="jelly:core" xmlns:util="jelly:util"
xmlns:ant="jelly:ant">
   
  -  <ant:property name="maven.ui.banner.background" value="#fff"/>
  -  <ant:property name="maven.ui.banner.foreground" value="#000"/>
  -  <ant:property name="sun.j2se.link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
  -  <ant:property name="framework.api.link" value="http://avalon.apache.org/framework/api/"/>
  -  <ant:property name="maven.javadoc.links" value="${sun.j2se.link},${framework.api.link}"/>
  +  <!--
  +  ==============================================================================
  +  switches 
  +  ==============================================================================
  +  -->
  +
  +  <ant:property name="avalon.snapshot" value="true"/>
  +
  +  <!--
  +  ==============================================================================
  +  dependent properties 
  +  ==============================================================================
  +  -->
   
     <ant:property name="maven.dist.assembly.dir"
       value="${maven.build.dir}/temp"/>
  @@ -19,6 +27,18 @@
     <ant:property name="maven.dist.dir"
       value="${maven.build.dir}/distributions"/>
   
  +  <!--
  +  ==============================================================================
  +  structural properties 
  +  ==============================================================================
  +  -->
  +
  +  <ant:property name="maven.ui.banner.background" value="#fff"/>
  +  <ant:property name="maven.ui.banner.foreground" value="#000"/>
  +  <ant:property name="sun.j2se.link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
  +  <ant:property name="framework.api.link" value="http://avalon.apache.org/framework/api/"/>
  +  <ant:property name="maven.javadoc.links" value="${sun.j2se.link},${framework.api.link}"/>
  +
     <goal name="avalon:clean" prereqs="clean">
       <maven:reactor
         basedir="${basedir}"
  @@ -37,13 +57,26 @@
         ignoreFailures="false"
         postProcessing="true" />
   
  -    <ant:copy todir="${maven.build.dir}">
  +    <ant:copy todir="${maven.build.dir}/jars">
         <j:forEach var="child" items="${reactorProjects}">
           <ant:fileset dir="${child.file.parentFile}/target">
             <ant:include name="${child.artifactId}-${child.currentVersion}.jar"/>
           </ant:fileset>
         </j:forEach>
       </ant:copy>
  +    <j:forEach var="child" items="${reactorProjects}">
  +      <j:set var="path" 
  +          value="${child.artifactId}-${child.currentVersion}.jar"/>
  +      <checksum file="${maven.build.dir}/jars/${path}"/>
  +      <j:if test="${maven_gpg_exe != null}">
  +        <ant:exec executable="${maven_gpg_exe}">
  +          <ant:arg value="-a"/>
  +          <ant:arg value="--yes"/>
  +          <ant:arg value="-b"/>
  +          <ant:arg value="${maven.build.dir}/jars/${path}"/>
  +        </ant:exec>
  +      </j:if>
  +    </j:forEach>
     </goal>
   
     <goal name="avalon:build-snapshot">
  @@ -133,7 +166,7 @@
       <!-- Copy Jars -->
       <ant:copy todir="${maven.dist.bin.assembly.dir}">
         <ant:fileset dir="${maven.build.dir}">
  -        <ant:include name="*.jar"/>
  +        <ant:include name="jars/**"/>
           <ant:include name="docs/**"/>
         </ant:fileset>
       </ant:copy>
  @@ -192,6 +225,18 @@
       description="Set up directories for a distribution build">
       <ant:delete dir="${maven.dist.dir}"/>
       <ant:mkdir dir="${maven.dist.dir}"/>
  +    <j:choose>
  +      <j:when test="${avalon.snapshot}">
  +        <maven:snapshot project="${pom}"/>
  +        <j:set var="timestamp" value="${snapshotSignature.substring(12)}"/>
  +        <j:set var="build.name" value="${maven.final.name}-${timestamp}"/>
  +        <echo>Snapshot Packaging: ${timestamp}</echo>
  +      </j:when>
  +      <j:otherwise>
  +        <j:set var="build.name" value="${maven.final.name}"/>
  +        <echo>Release Packaging: ${pom.currentVersion}</echo>
  +      </j:otherwise>
  +    </j:choose>
     </goal>
   
   
  @@ -201,22 +246,35 @@
       description="Build the binary distribution.">
   
       <!-- Create a tar.gz file -->
  -    <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
  +    <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${build.name}-bin.tar">
         <ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
       </ant:tar>
  -
       <ant:gzip 
  -      zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
  -      src="${maven.dist.dir}/${maven.final.name}.tar"
  +      zipfile="${maven.dist.dir}/${build.name}-bin.tar.gz"
  +      src="${maven.dist.dir}/${build.name}-bin.tar"
       />
  -    <checksum file="${maven.dist.dir}/${maven.final.name}.tar.gz"/>
  -    <ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
  +    <ant:delete file="${maven.dist.dir}/${build.name}-bin.tar"/>
  +    <checksum file="${maven.dist.dir}/${build.name}-bin.tar.gz"/>
  +    <j:if test="${maven_gpg_exe != null}">
  +      <ant:exec executable="${maven_gpg_exe}">
  +        <ant:arg value="-a"/>
  +        <ant:arg value="-b"/>
  +        <ant:arg value="${maven.dist.dir}/${build.name}-bin.tar.gz"/>
  +      </ant:exec>
  +    </j:if>
   
       <!-- Create a zip file -->
  -    <ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
  +    <ant:zip zipfile="${maven.dist.dir}/${build.name}-bin.zip">
         <ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
       </ant:zip>
  -    <checksum file="${maven.dist.dir}/${maven.final.name}.zip"/>
  +    <checksum file="${maven.dist.dir}/${build.name}-bin.zip"/>
  +    <j:if test="${maven_gpg_exe != null}">
  +      <ant:exec executable="${maven_gpg_exe}">
  +        <ant:arg value="-a"/>
  +        <ant:arg value="-b"/>
  +        <ant:arg value="${maven.dist.dir}/${build.name}-bin.zip"/>
  +      </ant:exec>
  +    </j:if>
     </goal>
   
     <goal
  @@ -225,21 +283,35 @@
       description="Build the source distribution.">
    
       <!-- Create a tar.gz file -->
  -    <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
  +    <ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${build.name}-src.tar">
         <ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
       </ant:tar>
       <ant:gzip 
  -      zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz" 
  -      src="${maven.dist.dir}/${maven.final.name}-src.tar"
  +      zipfile="${maven.dist.dir}/${build.name}-src.tar.gz" 
  +      src="${maven.dist.dir}/${build.name}-src.tar"
       />
  -    <checksum file="${maven.dist.dir}/${maven.final.name}-src.tar.gz"/>
  -    <ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
  +    <ant:delete file="${maven.dist.dir}/${build.name}-src.tar"/>
  +    <checksum file="${maven.dist.dir}/${build.name}-src.tar.gz"/>
  +    <j:if test="${maven_gpg_exe != null}">
  +      <ant:exec executable="${maven_gpg_exe}">
  +        <ant:arg value="-a"/>
  +        <ant:arg value="-b"/>
  +        <ant:arg value="${maven.dist.dir}/${build.name}-src.tar.gz"/>
  +      </ant:exec>
  +    </j:if>
   
       <!-- Create a zip file -->
  -    <ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
  +    <ant:zip zipfile="${maven.dist.dir}/${build.name}-src.zip">
         <ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
       </ant:zip>
  -    <checksum file="${maven.dist.dir}/${maven.final.name}-src.zip"/>
  +    <checksum file="${maven.dist.dir}/${build.name}-src.zip"/>
  +    <j:if test="${maven_gpg_exe != null}">
  +      <ant:exec executable="${maven_gpg_exe}">
  +        <ant:arg value="-a"/>
  +        <ant:arg value="-b"/>
  +        <ant:arg value="${maven.dist.dir}/${build.name}-src.zip"/>
  +      </ant:exec>
  +    </j:if>
     </goal>
   
   </project>
  
  
  
  1.3       +22 -0     avalon/util/defaults/src/java/org/apache/avalon/util/defaults/DefaultsBuilder.java
  
  Index: DefaultsBuilder.java
  ===================================================================
  RCS file: /home/cvs/avalon/util/defaults/src/java/org/apache/avalon/util/defaults/DefaultsBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultsBuilder.java	17 Feb 2004 11:30:04 -0000	1.2
  +++ DefaultsBuilder.java	19 Feb 2004 08:58:05 -0000	1.3
  @@ -210,26 +210,48 @@
       // implementation
       //--------------------------------------------------------------
   
  +   /**
  +    * Return the application home directory.
  +    * @return the home directory
  +    */
       public File getHomeDirectory()
       {
           return m_root;
       }
   
  +   /**
  +    * Return the application properties.  Properties returned are resolved
  +    * relative to a properties file named [key].properties in the 
  +    * application home directory.
  +    *
  +    * @return the home directory
  +    */
       public Properties getHomeProperties()
       {
           return m_home;
       }
   
  +   /**
  +    * Return the application specific properties from the users home directory.
  +    * @return the user's application properties
  +    */
       public Properties getUserProperties()
       {
           return m_user;
       }
   
  +   /**
  +    * Return the application specific properties from the current working directory.
  +    * @return the working application properties
  +    */
       public Properties getDirProperties()
       {
           return m_dir;
       }
   
  +   /**
  +    * Return a consolidated set of properties.
  +    */
       public Properties getConsolidatedProperties( 
         final Properties defaults, final String[] keys ) throws IOException
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message