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/tutorial/contextualization/src/java/tutorial StandardComponent.java
Date Wed, 04 Jun 2003 09:43:44 GMT
mcconnell    2003/06/04 02:43:44

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl
                        DefaultDeploymentService.java
               merlin/merlin-smp/src/tutorial/contextualization/src/java/tutorial
                        StandardComponent.java
  Log:
  Addition of Executable lifecycle phase support.
  
  Revision  Changes    Path
  1.9       +11 -1     avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/DefaultDeploymentService.java
  
  Index: DefaultDeploymentService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/impl/DefaultDeploymentService.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultDeploymentService.java	4 Jun 2003 09:28:44 -0000	1.8
  +++ DefaultDeploymentService.java	4 Jun 2003 09:43:44 -0000	1.9
  @@ -58,6 +58,7 @@
   import org.apache.avalon.assembly.locator.Locator;
   import org.apache.avalon.assembly.locator.impl.DefaultLocator;
   import org.apache.avalon.assembly.logging.LoggingManager;
  +import org.apache.avalon.framework.activity.Executable;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
  @@ -284,6 +285,15 @@
                       getLogger().debug( message );
                   }
                   ((Startable)instance).start();
  +            }
  +            else if( instance instanceof Executable )
  +            {
  +                if( getLogger().isDebugEnabled() )
  +                {
  +                    final String message = "executing " + appliance;
  +                    getLogger().debug( message );
  +                }
  +                ((Executable)instance).execute();
               }
   
               return instance;
  
  
  
  1.2       +14 -2     avalon-sandbox/merlin/merlin-smp/src/tutorial/contextualization/src/java/tutorial/StandardComponent.java
  
  Index: StandardComponent.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/merlin-smp/src/tutorial/contextualization/src/java/tutorial/StandardComponent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StandardComponent.java	4 Jun 2003 05:27:10 -0000	1.1
  +++ StandardComponent.java	4 Jun 2003 09:43:44 -0000	1.2
  @@ -59,6 +59,7 @@
   
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.activity.Executable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   
   /**
  @@ -68,7 +69,7 @@
    * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
    */
   public class StandardComponent extends AbstractLogEnabled
  -    implements Contextualizable, Initializable, Disposable, StandardService
  +    implements Contextualizable, Initializable, Executable, Disposable, StandardService
   {
       private File m_home;
       private File m_work;
  @@ -106,7 +107,6 @@
             + "\n  work: " + m_work
             + "\n  name: " + m_name
             + "\n  partition: " + m_partition;
  -        printMessage();
       }
   
       //=======================================================================
  @@ -119,6 +119,18 @@
       public void dispose()
       {
           getLogger().debug( "dispose" );
  +    }
  +
  +    //=======================================================================
  +    // Executable
  +    //=======================================================================
  +
  +    /**
  +     * Execute the component.
  +     */
  +    public void execute()
  +    {
  +        printMessage();
       }
   
       //=======================================================================
  
  
  

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


Mime
View raw message