continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r726965 - in /continuum/branches/continuum-parallel-builds: continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
Date Tue, 16 Dec 2008 05:30:58 GMT
Author: oching
Date: Mon Dec 15 21:30:58 2008
New Revision: 726965

URL: http://svn.apache.org/viewvc?rev=726965&view=rev
Log:
implement cancel prepare builds in builds manager

Modified:
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java

Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=726965&r1=726964&r2=726965&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
Mon Dec 15 21:30:58 2008
@@ -135,7 +135,7 @@
 
     // public boolean cancelPrepareBuild(int projectId) throws BuildManagerException;
 
-    // public boolean cancelAllPrepareBuilds() throws BuildManagerException;
+    boolean cancelAllPrepareBuilds() throws BuildManagerException;
 
     /**
      * Removes the project from the build queue.
@@ -199,11 +199,10 @@
      */
     void removeProjectsFromCheckoutQueueWithHashcodes( int[] hashcodes )
         throws BuildManagerException;
+    
+    /*void removeProjectFromPrepareBuildQueue( int projectId ) throws BuildManagerException;
 
-    // TODO: implement this!
-    // public void removeProjectFromPrepareBuildQueue( int projectId );
-
-    // public void removeProjectsFromPrepareBuildQueue( int[] projectIds );
+    void removeProjectsFromPrepareBuildQueue( int[] projectIds ) throws BuildManagerException;*/
 
     /**
      * Add an overall build queue.

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=726965&r1=726964&r2=726965&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
Mon Dec 15 21:30:58 2008
@@ -49,6 +49,7 @@
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
 import org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
@@ -621,13 +622,9 @@
             throw new BuildManagerException( "Error encountered while removing project(s)
from build queue.", e );
         }
     }
-
+    
     public void addOverallBuildQueue( OverallBuildQueue overallBuildQueue )
-    {
-        // set the container which is used by overall build queue for getting the task queue
executor
-        // trying to avoid implementing Contextualizable for the OverallBuildQueue! 
-        //overallBuildQueue.setContainer( container );
-
+    {   
         synchronized ( overallBuildQueues )
         {
             if ( overallBuildQueues.get( overallBuildQueue.getId() ) == null )
@@ -824,10 +821,30 @@
             return checkoutsInQueue;
         }
     }
+    
+    public boolean cancelAllPrepareBuilds() throws BuildManagerException
+    {
+        try
+        {
+            TaskQueueExecutor executor = ( TaskQueueExecutor ) container.lookup( TaskQueueExecutor.class,
"prepare-build-project" );
+            Task task = executor.getCurrentTask();            
+            if( task != null )
+            {
+                executor.cancelTask( task );
+            }
+        }
+        catch ( ComponentLookupException e )
+        {
+            throw new BuildManagerException( "Error looking up prepare-build-queue.", e );
+        }
+        
+        return false;
+    }
 
     public boolean isBuildInProgress()
         throws BuildManagerException
-    {
+    {        
+        //TODO!
         return false;
     }
 



Mime
View raw message