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-smp/src/repository/james block.xml
Date Thu, 01 May 2003 10:45:24 GMT
mcconnell    2003/05/01 03:45:23

  Modified:    merlin   project.xml
               merlin/assembly project.xml
               merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl
                        ContextBuilder.java DefaultAppliance.java
               merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl
                        FileRepository.java
               merlin/merlin-smp/src/repository/james block.xml
  Log:
  Update internal documentation on context entries.
  
  Revision  Changes    Path
  1.11      +32 -24    avalon-sandbox/merlin/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/project.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- project.xml	26 Apr 2003 12:37:42 -0000	1.10
  +++ project.xml	1 May 2003 10:45:22 -0000	1.11
  @@ -71,6 +71,38 @@
           <role>Code enhancements.</role>
         </roles>
       </developer>
  +    <developer>
  +      <name>Vinay Chandran</name>
  +      <id>vinayc</id>
  +      <email>vinayc@apache.org</email>
  +      <roles>
  +        <role>Testing and bug reporting.</role>
  +      </roles>
  +    </developer>
  +    <developer>
  +      <name>Marcus Crafter</name>
  +      <id>crafterm</id>
  +      <email>crafterm@apache.org</email>
  +      <roles>
  +        <role>Architecture review and Fortress/ECM/Cocoon liason.</role>
  +      </roles>
  +    </developer>
  +    <developer>
  +      <name>Peter Royal</name>
  +      <id>proyal</id>
  +      <email>proyal@apache.org</email>
  +      <roles>
  +        <role>Test and evaluation.</role>
  +      </roles>
  +    </developer>
  +    <developer>
  +      <name>Leif Mortenson</name>
  +      <email>leif@apache.org</email>
  +      <id>leif</id>
  +      <roles>
  +        <role>Support on setup of NT service scripts and resources.</role>
  +      </roles>
  +    </developer>
     </developers>
   
     <contributors>
  @@ -83,14 +115,6 @@
         </roles>
       </contributor>
       <contributor>
  -      <name>Marcus Crafter</name>
  -      <id>crafterm</id>
  -      <email>crafterm@apache.org</email>
  -      <roles>
  -        <role>Architecture review and Fortress/ECM/Cocoon liason.</role>
  -      </roles>
  -    </contributor>
  -    <contributor>
         <name>Richard Wallace</name>
         <email>rwallace@a--i--m.com</email>
         <organization>A-I-M</organization>
  @@ -99,27 +123,11 @@
         </roles>
       </contributor>
       <contributor>
  -      <name>Peter Royal</name>
  -      <id>proyal</id>
  -      <email>proyal@apache.org</email>
  -      <roles>
  -        <role>Test and evaluation.</role>
  -      </roles>
  -    </contributor>
  -    <contributor>
         <name>Jörg Schaible</name>
         <email>Joerg.Schaible@gft.com</email>
         <organization>GFT</organization>
         <roles>
           <role>Test, evaluation and contribution of German language i18n resources.</role>
  -      </roles>
  -    </contributor>
  -    <contributor>
  -      <name>Leif Mortenson</name>
  -      <email>leif@apache.org</email>
  -      <id>leif</id>
  -      <roles>
  -        <role>Support on setup of NT service scripts and resources.</role>
         </roles>
       </contributor>
       <contributor>
  
  
  
  1.6       +2 -0      avalon-sandbox/merlin/assembly/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/project.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project.xml	30 Apr 2003 10:41:04 -0000	1.5
  +++ project.xml	1 May 2003 10:45:23 -0000	1.6
  @@ -105,6 +105,7 @@
   
     </dependencies>
     
  +  <!--
     <build>
   
       <nagEmailAddress>dev@avalon.apache.org</nagEmailAddress>
  @@ -162,5 +163,6 @@
       
       <jars></jars>
     </build>
  +  -->
   
   </project>
  
  
  
  1.2       +29 -16    avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/ContextBuilder.java
  
  Index: ContextBuilder.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/ContextBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ContextBuilder.java	26 Apr 2003 12:37:43 -0000	1.1
  +++ ContextBuilder.java	1 May 2003 10:45:23 -0000	1.2
  @@ -53,7 +53,7 @@
   import java.util.HashMap;
   import java.util.Map;
   
  -import org.apache.avalon.assembly.engine.RepositoryManager;
  +import org.apache.avalon.assembly.engine.service.ServiceRepository;
   import org.apache.avalon.assembly.engine.service.UnknownServiceException;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  @@ -77,7 +77,11 @@
   
       /**
        * Internal utility to construct a context map using a descriptor, directive and source
  -     * context instances.
  +     * context instances.  The returned map contains the Merlin standard context entries
  +     * and equivalent legacy support for Phoenix together with any custom context entries.
  +     * Custom entry requirements are established by the supplied ContextDescriptor and

  +     * and are populated based on directives contained in the supplied ContextDirective.
  +     * 
        *
        * @param classloader the classloader
        * @param descriptor the target component context descriptor
  @@ -88,7 +92,7 @@
        * @exception ContextException if a required context value cannot be resolved
        */
       static Map buildContextMap(
  -            ClassLoader classloader, RepositoryManager repository, ContextDescriptor descriptor,
  +            ClassLoader classloader, ServiceRepository services, ContextDescriptor descriptor,
               ContextDirective directive, Context context )
               throws ContextException
       {
  @@ -104,15 +108,8 @@
           Map map = new HashMap();
   
           //
  -        // Phoenix legacy support
  -        //
  -
  -        map.put( "app.name", context.get( "urn:avalon:name" ) );
  -        map.put( "app.home", context.get( "urn:avalon:home" ) );
  -
  -        //
           // Merlin standard entries
  -        //
  +        // -----------------------
   
           map.put( "urn:avalon:name", context.get( "urn:avalon:name" ) );
           map.put( "urn:avalon:home", context.get( "urn:avalon:home" ) );
  @@ -126,11 +123,28 @@
           map.put( "urn:avalon:partition.name", context.get( "urn:avalon:partition" ) );
   
           //
  +        // Phoenix legacy support
  +        // ----------------------
  +        // app.name   corresponds to the application name, equivalent to 
  +        //            a Merlin partition
  +        // block.name corresponds to the name of the component instance
  +        // app.work   a directory shared by all of the components within 
  +        //            the appplication (equivalent to a container in 
  +        //            Merlin
  +        //
  +
  +        map.put( "app.name", context.get( "urn:avalon:partition" ) );
  +        map.put( "block.name", context.get( "urn:avalon:name" ) );
  +        map.put( "app.home", context.get( "urn:avalon:home" ) );
  +
  +        // 
  +        // Custom Entries
  +        // --------------
           // get the entries declared by the context descriptor plus and
           // entries declared within a service definition if one exists
           //
   
  -        EntryDescriptor[] entries = getMergedEntries( repository, descriptor );
  +        EntryDescriptor[] entries = getMergedEntries( services, descriptor );
   
           //
           // commence population of the map
  @@ -271,13 +285,12 @@
       }
   
       private static EntryDescriptor[] getMergedEntries(
  -            RepositoryManager repository, ContextDescriptor descriptor )
  +            ServiceRepository services, ContextDescriptor descriptor )
               throws IllegalArgumentException
       {
           try
           {
  -            Service service =
  -                    repository.getServiceRepository().getService( descriptor.getReference()
);
  +            Service service = services.getService( descriptor.getReference() );
               EntryDescriptor[] result = descriptor.merge( service.getEntries() );
               return result;
           } catch( UnknownServiceException e )
  
  
  
  1.6       +5 -3      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/DefaultAppliance.java
  
  Index: DefaultAppliance.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/DefaultAppliance.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultAppliance.java	29 Apr 2003 17:26:26 -0000	1.5
  +++ DefaultAppliance.java	1 May 2003 10:45:23 -0000	1.6
  @@ -64,8 +64,9 @@
   import org.apache.avalon.assembly.appliance.ApplianceException;
   import org.apache.avalon.assembly.appliance.ApplianceRuntimeException;
   import org.apache.avalon.assembly.engine.Engine;
  -import org.apache.avalon.assembly.engine.impl.EngineClassLoader;
   import org.apache.avalon.assembly.engine.RepositoryManager;
  +import org.apache.avalon.assembly.engine.service.ServiceRepository;
  +import org.apache.avalon.assembly.engine.impl.EngineClassLoader;
   import org.apache.avalon.assembly.lifestyle.LifestyleHandler;
   import org.apache.avalon.assembly.lifestyle.LifestyleService;
   import org.apache.avalon.assembly.locator.Contextualizable;
  @@ -797,8 +798,9 @@
               Context source = new DefaultContext( map, m_system );
               ContextDirective directive = m_applianceContext.getContextDirective();
               RepositoryManager repository = m_engine.getRepository();
  +            ServiceRepository services = repository.getServiceRepository();
               return ContextBuilder.buildContextMap(
  -                    m_engine, repository, descriptor, directive, source );
  +                    m_engine, services, descriptor, directive, source );
           } catch( Throwable e )
           {
               final String error =
  
  
  
  1.3       +34 -3     avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl/FileRepository.java
  
  Index: FileRepository.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/repository/impl/FileRepository.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileRepository.java	30 Apr 2003 10:24:12 -0000	1.2
  +++ FileRepository.java	1 May 2003 10:45:23 -0000	1.3
  @@ -275,16 +275,27 @@
           expand( group, file );
       }
   
  +   /**
  +    * Replicate an group application package using the available hosts in 
  +    * order implied by the hosts sequence. 
  +    * 
  +    * @param group the group identifier
  +    * @param file the target file
  +    * @exception RepositoryException if the replication was not successful
  +    */
       public void download( String group, File file ) throws RepositoryException
       {
           final List errors = new ArrayList();
           if( getRemoteResource( group, file, errors ) )
           {
  -            //return getArtifact( group, name, version, type );
  -            System.out.println( "SUCCESS" );
               return;
           }
   
  +        //
  +        // build a consolidated exception - this code will be updated 
  +        // to use a special exception that contains the exception set
  +        //
  +
           RepositoryException[] exceptions = 
            (RepositoryException[]) errors.toArray( new RepositoryException[0] );
   
  @@ -298,14 +309,30 @@
               ExceptionHelper.packException( "Connection: " + (i+1), exceptions[i] );
               buffer.append( message );
           }
  +
           throw new RepositoryException( buffer.toString() );
       }
   
  +   /**
  +    * Expand the supplied file under the declared group identifier.
  +    * @param group the group identifier
  +    * @param file the file to expand
  +    */
       public void expand( String group, File file )
       {
           // todo
       }
   
  +   /**
  +    * Replicate a resource from one of the remote servers to the repository
  +    * base directory.  If the replication is unsuccessful, the list will 
  +    * the set of exceptions raised during host traversal.
  +    *
  +    * @param group the group identifier
  +    * @param file the file that the resource should be downloaded to
  +    * @param list an empty list into which any exceptions should be included
  +    * @return TRUE if the resource was sucefully replicated else FALSE
  +    */
       private boolean getRemoteResource( String group, File file, List errors )
       {
           for( int i=0; i<m_hosts.length; i++ )
  @@ -313,7 +340,11 @@
               URL url = m_hosts[i];
               try
               {
  -                final URL path = new URL( url, url.getPath() + group + "/" + group + "-package.zip"
);
  +                final URL path = new URL( 
  +                  url, url.getPath() 
  +                  + group + "/" 
  +                  + group + "-package.zip" );
  +
                   transfer( path, file );
                   return true;
               }
  
  
  
  1.5       +1 -1      avalon-sandbox/merlin/merlin-smp/src/repository/james/block.xml
  
  Index: block.xml
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/src/repository/james/block.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- block.xml	15 Apr 2003 02:39:43 -0000	1.4
  +++ block.xml	1 May 2003 10:45:23 -0000	1.5
  @@ -3,7 +3,7 @@
   Sample block descriptor that demonstrates the James mailsever application as a composite
block.
   -->
   
  -<block name="james">
  +<block>
   
      <info>
        <name>james</name>
  
  
  

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


Mime
View raw message