continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r165321 - /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue /maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus /maven/continuum/trunk/continuum-plexus-application
Date Fri, 29 Apr 2005 17:54:08 GMT
Author: trygvis
Date: Fri Apr 29 10:54:07 2005
New Revision: 165321

URL: http://svn.apache.org/viewcvs?rev=165321&view=rev
Log:
o Using the new task queue to execute the builds.

Added:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/DefaultBuildQueue.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-plexus-application/pom.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=165321&r1=165320&r2=165321&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Fri Apr 29 10:54:07 2005
@@ -23,18 +23,16 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Iterator;
-import java.util.Properties;
 import java.util.List;
+import java.util.Properties;
 
-import org.apache.maven.continuum.buildcontroller.BuildController;
 import org.apache.maven.continuum.builder.ContinuumBuilder;
 import org.apache.maven.continuum.builder.ant.AntBuilder;
 import org.apache.maven.continuum.builder.manager.BuilderManager;
 import org.apache.maven.continuum.builder.maven.m1.Maven1Builder;
 import org.apache.maven.continuum.builder.maven.m2.MavenShellBuilder;
 import org.apache.maven.continuum.builder.shell.ShellBuilder;
-import org.apache.maven.continuum.buildqueue.BuildQueue;
-import org.apache.maven.continuum.buildqueue.BuildQueueException;
+import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
@@ -42,15 +40,17 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.ContinuumScmException;
-import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
@@ -80,10 +80,16 @@
     private BuilderManager builderManager;
 
     /** @requirement */
-    private BuildController buildController;
+//    private BuildController buildController;
 
     /** @requirement */
-    private BuildQueue buildQueue;
+//    private BuildQueue buildQueue;
+
+    /** @requirement */
+    private TaskQueue buildQueue;
+
+    /** @requirement */
+    private TaskQueue checkOutQueue;
 
     /** @requirement */
     private ContinuumStore store;
@@ -101,7 +107,7 @@
     //
     // ----------------------------------------------------------------------
 
-    private BuilderThread builderThread;
+//    private BuilderThread builderThread;
 
     private Thread builderThreadThread;
 
@@ -370,7 +376,7 @@
 
             getLogger().info( "Build id: '" + buildId + "'." );
 
-            buildQueue.enqueue( projectId, buildId );
+            buildQueue.put( new BuildProjectTask( projectId, buildId ) );
 
             return buildId;
         }
@@ -380,7 +386,7 @@
 
             throw new ContinuumException( "Error while creating build object.", e );
         }
-        catch ( BuildQueueException e )
+        catch ( TaskQueueException e )
         {
             getLogger().error( "Error while enqueuing project.", e );
 
@@ -760,7 +766,7 @@
 
         try
         {
-            CheckOutScmResult result = scm.checkOut( project, checkoutDirectory);
+            scm.checkOut( project, checkoutDirectory);
         }
         catch ( ContinuumScmException e )
         {
@@ -845,6 +851,7 @@
         getLogger().info( "Starting Continuum." );
 
         // start the builder thread
+/*
         builderThread = new BuilderThread( buildController, buildQueue, getLogger() );
 
         builderThreadThread = new Thread( builderThread );
@@ -852,7 +859,7 @@
         builderThreadThread.setDaemon( true );
 
         builderThreadThread.start();
-
+*/
         // ----------------------------------------------------------------------
         //
         // ----------------------------------------------------------------------
@@ -900,12 +907,12 @@
     public void stop()
         throws Exception
     {
+        getLogger().info( "Stopping Continuum." );
+/*
         int maxSleep = 10 * 1000; // 10 seconds
         int interval = 1000;
         int slept = 0;
 
-        getLogger().info( "Stopping Continuum." );
-
         // signal the thread to stop
         builderThread.shutdown();
 
@@ -937,7 +944,7 @@
             // TODO: should use System.currentTimeMillis()
             slept += interval;
         }
-
+*/
         getLogger().info( "Continuum stopped." );
     }
 

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java?rev=165321&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
(added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
Fri Apr 29 10:54:07 2005
@@ -0,0 +1,55 @@
+package org.apache.maven.continuum.buildcontroller;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.buildqueue.BuildProjectTask;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.codehaus.plexus.taskqueue.Task;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id:$
+ */
+public class BuildProjectTaskExecutor
+    extends AbstractLogEnabled
+    implements TaskExecutor, Initializable
+{
+    private BuildController controller;
+
+    // ----------------------------------------------------------------------
+    // Component Lifecycle
+    // ----------------------------------------------------------------------
+
+    public void initialize()
+    {
+    }
+
+    // ----------------------------------------------------------------------
+    // TaskExecutor Implementation
+    // ----------------------------------------------------------------------
+
+    public void executeTask( Task task )
+        throws Exception
+    {
+        BuildProjectTask buildProjectTask = (BuildProjectTask) task;
+
+        controller.build( buildProjectTask.getBuildId() );
+    }
+}

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java?rev=165321&r1=165320&r2=165321&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
Fri Apr 29 10:54:07 2005
@@ -31,13 +31,13 @@
 
     private long timestamp;
 
-    public BuildProjectTask( String projectId, String buildId, long timestamp )
+    public BuildProjectTask( String projectId, String buildId )
     {
         this.projectId = projectId;
 
         this.buildId = buildId;
 
-        this.timestamp = timestamp;
+        this.timestamp = System.currentTimeMillis();
     }
 
     public String getProjectId()

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/DefaultBuildQueue.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/DefaultBuildQueue.java?rev=165321&r1=165320&r2=165321&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/DefaultBuildQueue.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/DefaultBuildQueue.java
Fri Apr 29 10:54:07 2005
@@ -57,7 +57,7 @@
     public void enqueue( String projectId, String buildId )
         throws BuildQueueException
     {
-        BuildProjectTask task = new BuildProjectTask( projectId, buildId, System.currentTimeMillis()
);
+        BuildProjectTask task = new BuildProjectTask( projectId, buildId );
 
         try
         {

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=165321&r1=165320&r2=165321&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Fri Apr 29 10:54:07 2005
@@ -7,12 +7,26 @@
         <requirement>
           <role>org.apache.maven.continuum.builder.manager.BuilderManager</role>
         </requirement>
+<!--
         <requirement>
           <role>org.apache.maven.continuum.buildcontroller.BuildController</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.continuum.buildqueue.BuildQueue</role>
         </requirement>
+-->
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>build-project</role-hint>
+          <field-name>buildQueue</field-name>
+        </requirement>
+<!--
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>check-out-queue</role-hint>
+          <field-name>checkOutQueue</field-name>
+        </requirement>
+-->
         <requirement>
           <role>org.apache.maven.continuum.store.ContinuumStore</role>
         </requirement>
@@ -78,13 +92,14 @@
         </requirement>
       </requirements>
     </component>
-
+<!-- TODO: remove -->
     <component>
       <role>org.apache.maven.continuum.buildqueue.BuildQueue</role>
       <implementation>org.apache.maven.continuum.buildqueue.DefaultBuildQueue</implementation>
       <requirements>
         <requirement>
           <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>build-project</role-hint>
         </requirement>
       </requirements>
     </component>
@@ -244,12 +259,13 @@
 
     <!--
      |
-     | Task Queue
+     | Build Task Queue
      |
      |-->
 
     <component>
       <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+      <role-hint>build-project</role-hint>
       <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
       <lifecycle-handler>plexus-configurable</lifecycle-handler>
       <configuration>
@@ -272,6 +288,79 @@
       </configuration>
     </component>
 
+    <component>
+      <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+      <role-hint>build-project</role-hint>
+      <implementation>org.apache.maven.continuum.buildcontroller.BuildProjectTaskExecutor</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.buildcontroller.BuildController</role>
+        </requirement>
+      </requirements>
+    </component>
+
+    <component>
+      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
+      <role-hint>build-project</role-hint>
+      <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+          <role-hint>build-project</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>build-project</role-hint>
+        </requirement>
+      </requirements>
+      <configuration>
+        <name>build-project</name>
+      </configuration>
+    </component>
+
+    <!--
+     |
+     | Check Out Task Queue
+     |
+     |-->
+
+    <component>
+      <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+      <role-hint>check-out-project</role-hint>
+      <implementation>org.codehaus.plexus.taskqueue.DefaultTaskQueue</implementation>
+      <lifecycle-handler>plexus-configurable</lifecycle-handler>
+    </component>
+<!--
+    <component>
+      <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+      <role-hint>check-out-project</role-hint>
+      <implementation>org.apache.maven.continuum.buildcontroller.BuildProjectTaskExecutor</implementation>
+    </component>
+-->
+    <component>
+      <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
+      <role-hint>check-out-project</role-hint>
+      <implementation>org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.execution.TaskExecutor</role>
+          <role-hint>check-out-project</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
+          <role-hint>check-out-project</role-hint>
+        </requirement>
+      </requirements>
+      <configuration>
+        <name>check-out-project</name>
+      </configuration>
+    </component>
+
+    <!--
+     |
+     | Check Out Task Queue
+     |
+     |-->
     <component>
       <role>org.codehaus.plexus.jdo.JdoFactory</role>
       <implementation>org.codehaus.plexus.jdo.DefaultJdoFactory</implementation>

Modified: maven/continuum/trunk/continuum-plexus-application/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/pom.xml?rev=165321&r1=165320&r2=165321&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/pom.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/pom.xml Fri Apr 29 10:54:07 2005
@@ -98,22 +98,22 @@
         <goals>
           <goal>
             <id>app</id>
+            <configuration>
+              <applicationConfiguration>src/conf/application.xml</applicationConfiguration>
+              <configurationProperties>app.properties</configurationProperties>
+              <applicationName>continuum</applicationName>
+            </configuration>
           </goal>
           <goal>
             <id>bundle-application</id>
           </goal>
           <goal>
             <id>test-runtime</id>
+            <configuration>
+              <testRuntimeConfiguration>src/test/conf/testRuntimeConfiguration.xml</testRuntimeConfiguration>
+            </configuration>
           </goal>
         </goals>
-        <configuration>
-          <applicationName>continuum</applicationName>
-          <applicationConfiguration>src/conf/application.xml</applicationConfiguration>
-          <configurationProperties>app.properties</configurationProperties>
-          <configurationDirectory>src/conf</configurationDirectory>
-          <testRuntimeConfiguration>src/test/conf/testRuntimeConfiguration.xml</testRuntimeConfiguration>
-          <basedir>target</basedir>
-        </configuration>
       </plugin>
       <plugin>
         <artifactId>maven-assembly-plugin</artifactId>



Mime
View raw message