avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl DefaultKernel.java
Date Fri, 27 Jun 2003 22:54:18 GMT
mcconnell    2003/06/27 15:54:18

  Modified:    merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl
                        BlockInvocationHandler.java VirtualService.java
               merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl
                        DefaultKernel.java
  Log:
  Integration of support for the new repository implentation.
  
  Revision  Changes    Path
  1.5       +10 -2     avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/BlockInvocationHandler.java
  
  Index: BlockInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/BlockInvocationHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlockInvocationHandler.java	9 Jun 2003 01:03:08 -0000	1.4
  +++ BlockInvocationHandler.java	27 Jun 2003 22:54:18 -0000	1.5
  @@ -120,7 +120,15 @@
   
                   String path = service.getPath();
                   String base = m_block.getURL().getPath();
  -                String source = base + path;
  +                String source = null;
  +                if( base.endsWith( "/" ) )
  +                {
  +                    source = base + path;
  +                }
  +                else
  +                {
  +                    source = base + "/" + path;
  +                }
                   URL url = new URL( m_block.getURL(), source );
                   Appliance provider = 
                     (Appliance) m_block.resolveAppliance( url.getPath() );
  
  
  
  1.2       +9 -2      avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/VirtualService.java
  
  Index: VirtualService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/VirtualService.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VirtualService.java	29 Apr 2003 21:07:36 -0000	1.1
  +++ VirtualService.java	27 Jun 2003 22:54:18 -0000	1.2
  @@ -80,7 +80,14 @@
       public VirtualService( ServiceDescriptor service, String path )
       {
           m_service = service;
  -        m_path = path;
  +        if( path.startsWith( "/" ) )
  +        {
  +            m_path = path.substring( 1, path.length() );
  +        }
  +        else
  +        {
  +            m_path = path;
  +        }
       }
   
      /**
  
  
  
  1.25      +12 -8     avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java
  
  Index: DefaultKernel.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/kernel/impl/DefaultKernel.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DefaultKernel.java	24 Jun 2003 16:04:50 -0000	1.24
  +++ DefaultKernel.java	27 Jun 2003 22:54:18 -0000	1.25
  @@ -77,6 +77,7 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.parameters.Parameters;
  @@ -438,18 +439,21 @@
   
           //
           // if a jar repository has not been provided during the 
  -        // contextualization stage, then try to build one based 
  -        // on the kernel configuration - and if necessary, fallback
  -        // on the default merlin/repository file based directory
  +        // contextualization stage, then build one based 
  +        // on the kernel configuration 
           //
   
           if( m_repository == null )
           {
               File local = new File( m_root, "repository" );
  -            Configuration rep = m_config.getChild( "repository" );
  -            String base = rep.getChild( "root" ).getValue( local.toString() );
  -            File repository = new File( base );
  -            m_repository = FileRepository.newInstance( repository );
  +            FileRepository repository = new FileRepository();
  +            repository.enableLogging( getLogger().getChildLogger( "repository" ) );
  +            DefaultContext context = new DefaultContext();
  +            context.put( FileRepository.BASE_KEY, local );
  +            context.makeReadOnly();
  +            repository.contextualize( context );
  +            repository.configure( m_config.getChild( "repository" ) );
  +            m_repository = repository;
           }
   
           //
  
  
  

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


Mime
View raw message