You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/03/17 03:46:27 UTC

cvs commit: avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance DefaultAppliance.java

mcconnell    2003/03/16 18:46:27

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/appliance
                        DefaultAppliance.java
  Log:
  Removed notion of appliance features (not used) and added explict operation for resolution of appliance dependencies (enabling classes derived from Appliance to override static type based dependency declarations - a.k.a. dynamic dependency generation)
  
  Revision  Changes    Path
  1.2       +23 -21    avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAppliance.java
  
  Index: DefaultAppliance.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/DefaultAppliance.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultAppliance.java	13 Mar 2003 01:03:42 -0000	1.1
  +++ DefaultAppliance.java	17 Mar 2003 02:46:27 -0000	1.2
  @@ -73,7 +73,6 @@
   import org.apache.avalon.assembly.lifestyle.LifestyleException;
   import org.apache.avalon.assembly.lifestyle.LifestyleService;
   import org.apache.avalon.assembly.lifestyle.LifestyleHandler;
  -import org.apache.avalon.assembly.lifecycle.AssemblyService;
   import org.apache.avalon.assembly.locator.Locator;
   import org.apache.avalon.assembly.locator.Contextualizable;
   import org.apache.avalon.assembly.locator.LocatorException;
  @@ -178,11 +177,6 @@
       private Map m_context;
   
       /**
  -     * The feature map.
  -     */
  -    private Map m_features = new Hashtable();
  -
  -    /**
        * The lifestyle handler.
        */
       private LifestyleHandler m_handler;
  @@ -411,6 +405,16 @@
           return m_applianceContext.getType();
       }
   
  +    /**
  +     * Return the set of runtime dependencies for the type.
  +     *
  +     * @return the set of runtim dependencies.
  +     */
  +    public DependencyDescriptor[] getDependencies()
  +    {
  +        return m_applianceContext.getType().getDependencies();
  +    }
  +
      /**
       * Get the appliance URL.
       * @return the appliance URL
  @@ -538,16 +542,6 @@
       }
   
       /**
  -     * Returns a map of appliance custom features.
  -     *
  -     * @return the feature map
  -     */
  -    public Map getFeatures()
  -    {
  -        return m_features;
  -    }
  -
  -    /**
        * Return the logging categories for the profile.
        *
        * @return the logger
  @@ -720,7 +714,8 @@
           catch( Throwable e )
           {
               final String error = 
  -              "Unexpected exception while preparing deployment context in appliance: " + this;
  +              "Unexpected exception while preparing deployment context in appliance: " 
  +              + this;
               throw new ApplianceException( error, e );
           }
   
  @@ -735,7 +730,8 @@
               Context source = new DefaultContext( map, m_system );
               ContextDirective directive = m_applianceContext.getContextDirective();
               RepositoryManager repository = m_engine.getRepository();
  -            return BUILDER.buildContextMap( m_engine, repository, descriptor, directive, source );
  +            return BUILDER.buildContextMap( 
  +              m_engine, repository, descriptor, directive, source );
           }
           catch( Throwable e )
           {
  @@ -853,6 +849,12 @@
       {
           getLogger().debug( "assembly: " + this );
           m_visited.add( this );
  +
  +        //
  +        // resolve a supplier for the contextualization phase
  +        // deployment dependency
  +        //
  +
           ContextDescriptor context = getType().getContext();
           String ext = context.getAttribute( 
             "urn:assembly:lifecycle.context.strategy" );
  @@ -893,11 +895,11 @@
           }
   
           //
  -        // for all of the declared dependencies - make sure the
  +        // for all of the declared runtime dependencies - make sure the
           // dependency is satisfied
           //
   
  -        DependencyDescriptor[] dependencies = getType().getDependencies();
  +        DependencyDescriptor[] dependencies = getDependencies();
           for( int i = 0; i < dependencies.length; i++ )
           {
               DependencyDescriptor dependency = dependencies[ i ];
  
  
  

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