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/06/19 13:23:22 UTC

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

mcconnell    2003/06/19 04:23:22

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl
                        DefaultApplianceContext.java
  Log:
  General housekeeping including considation of code relating to association of the profile within the appliance context.
  
  Revision  Changes    Path
  1.6       +22 -14    avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/DefaultApplianceContext.java
  
  Index: DefaultApplianceContext.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/appliance/impl/DefaultApplianceContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultApplianceContext.java	18 Jun 2003 11:16:13 -0000	1.5
  +++ DefaultApplianceContext.java	19 Jun 2003 11:23:22 -0000	1.6
  @@ -66,8 +66,6 @@
   import org.apache.avalon.meta.model.Profile;
   import org.apache.excalibur.configuration.CascadingConfiguration;
   
  -
  -
   /**
    * An appliance context aggregates the set of arguments that are supplied to
    * and appliance instance. These arguments are applied relative to a base
  @@ -87,7 +85,6 @@
        */
       private Profile m_profile;
   
  -
       /**
        * The activation policy - TRUE if activation on startup, FALSE to activate on request.
        */
  @@ -149,15 +146,9 @@
       public DefaultApplianceContext( Profile profile, Map map )
       {
           super( map );
  -        if( profile == null )
  -        {
  -            throw new NullPointerException( "profile" );
  -        }
  -        m_profile = profile;
  -        m_activation = profile.getActivationPolicy();
  +        setProfile( profile );
       }
   
  -
       //==============================================================
       // parameters
       //==============================================================
  @@ -187,7 +178,8 @@
           if( m_classname == null )
           {
               return getType().getInfo().getAttribute( Appliance.APPLIANCE_CLASS_KEY );
  -        } else
  +        } 
  +        else
           {
               return m_classname;
           }
  @@ -257,6 +249,23 @@
       }
   
       /**
  +     * Set the appliance profile.
  +     * @param profile the deployment profile
  +     * @exception NullPointerException if the supplied profile is null
  +     * @exception IllegalStateException if the context is write protected
  +     */
  +    private void setProfile( Profile profile )
  +    {
  +        checkWriteable();
  +        if( profile == null )
  +        {
  +            throw new NullPointerException( "profile" );
  +        }
  +        m_profile = profile;
  +        m_activation = profile.getActivationPolicy();
  +    }
  +
  +    /**
        * Get the appliance profile.
        * @return the profile
        */
  @@ -366,7 +375,6 @@
       public void setActivationPolicy( final boolean policy )
       {
           checkWriteable();
  -System.out.println( "SETTING ACTIVATION POLICY from: " + m_activation + " to " + policy );
           m_activation = policy;
       }
   
  @@ -384,7 +392,7 @@
   
       /**
        * Get the deployment context.
  -     * @return the deployment context
  +     * @return the deployment context (possibly null)
        */
       public Map getDeploymentMap()
       {
  
  
  

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