avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/assembly/appliance/builder ApplianceCreator.java ApplianceBuilder.java
Date Tue, 19 Nov 2002 12:30:39 GMT
mcconnell    2002/11/19 04:30:39

  Modified:    assembly/src/java/org/apache/excalibur/assembly/appliance/builder
                        ApplianceCreator.java ApplianceBuilder.java
  Log:
  Lots of updates that leverage seperation between builder and manager.
  
  Revision  Changes    Path
  1.2       +3 -3      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/assembly/appliance/builder/ApplianceCreator.java
  
  Index: ApplianceCreator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/assembly/appliance/builder/ApplianceCreator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ApplianceCreator.java	18 Nov 2002 11:02:29 -0000	1.1
  +++ ApplianceCreator.java	19 Nov 2002 12:30:39 -0000	1.2
  @@ -73,8 +73,8 @@
        * @return the appliance
        * @exception Exception if an error occurs during appliance creation
        */
  -    Appliance createAppliance( Configuration config )
  -        throws Exception;
  +    Appliance createAppliance( Profile profile, Configuration config )
  +      throws Exception;
   
       /**
        * Create an {@link Appliance} instances from the supplied arguments.
  
  
  
  1.3       +7 -63     jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/assembly/appliance/builder/ApplianceBuilder.java
  
  Index: ApplianceBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/assembly/appliance/builder/ApplianceBuilder.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ApplianceBuilder.java	19 Nov 2002 03:12:20 -0000	1.2
  +++ ApplianceBuilder.java	19 Nov 2002 12:30:39 -0000	1.3
  @@ -66,7 +66,7 @@
   import org.apache.excalibur.meta.model.builder.ProfileBuilder;
   import org.apache.excalibur.assembly.appliance.DefaultAppliance;
   import org.apache.excalibur.assembly.appliance.Appliance;
  -import org.apache.excalibur.assembly.type.TypeManager;
  +import org.apache.excalibur.assembly.profile.DefaultProfileManager;
   
   /**
    * A ApplianceBuilder is responsible for building an {@link Appliance}
  @@ -75,44 +75,8 @@
    * @author <a href="mailto:mcconnell@apache.org">Stephen McConnell</a>
    * @version $Revision$ $Date$
    */
  -public final class ApplianceBuilder implements Contextualizable
  +public final class ApplianceBuilder 
   {
  -    //==================================================================
  -    // state
  -    //==================================================================
  -
  -   /**
  -    * The profile building to use when creating the profile encapsulated 
  -    * within the appliance declaration (supplied during contextualization).
  -    */
  -    private ProfileBuilder m_profileBuilder;
  -
  -   /**
  -    * The type building to use when creating the profile encapsulated 
  -    * within the appliance declaration (supplied during contextualization).
  -    */
  -    private TypeManager m_typeManager;
  -
  -   /**
  -    * The profile classloader to use (supplied during contextualization).
  -    */
  -    private ClassLoader m_loader;
  -
  -    //==================================================================
  -    // Contextualizable
  -    //==================================================================
  -
  -   /**
  -    * Supply of the rutime context by the container managing this builder.
  -    * @param context the context
  -    * @exception ContextException if a required contect value was not supplied
  -    */
  -    public void contextualize( Context context ) throws ContextException
  -    {
  -        m_typeManager = (TypeManager) context.get("merlin:appliance.type-manager");
  -        m_profileBuilder = (ProfileBuilder) context.get("merlin:appliance.profile-builder");
  -        m_loader = (ClassLoader) context.get("merlin:appliance.classloader");
  -    }
   
       //==================================================================
       // ApplianceCreator
  @@ -124,10 +88,12 @@
       * @return the appliance
       * @exception Exception if an error occurs during appliance creation
       */
  -    public Appliance createAppliance( Configuration config )
  +    public Appliance createAppliance( Profile profile, Configuration config )
          throws Exception
       {
  -        return build( config );
  +        final boolean enabled = config.getAttributeAsBoolean( "enabled", true );
  +        final boolean activation = getActivationMode( config );
  +        return createAppliance( profile, enabled, activation );
       }
   
       /**
  @@ -168,28 +134,6 @@
               return false;
           }
           return config.getAttributeAsBoolean( "activation", false );
  -    }
  -
  -    /**
  -     * Build an Appliance from a configuration.
  -     *
  -     * @param config the appliance configuration fragment
  -     * @return the created Appliance
  -     * @throws Exception if an error occurs during apliance creation
  -     */
  -    private Appliance build( Configuration config )
  -        throws Exception
  -    {
  -        final boolean enabled =
  -            config.getAttributeAsBoolean( "enabled", true );
  -        final boolean activation =
  -            getActivationMode( config );
  -
  -        final Configuration conf = config.getChild("profile");
  -        String classname = conf.getAttribute("type");
  -        Type type = m_typeManager.registerType( classname );
  -        final Profile profile = m_profileBuilder.build( type, conf );
  -        return createAppliance( profile, enabled, activation );
       }
   
   }
  
  
  

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


Mime
View raw message