continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r727691 - in /continuum/branches/continuum-parallel-builds: continuum-api/src/main/java/org/apache/continuum/buildmanager/ continuum-api/src/main/java/org/apache/continuum/configuration/ continuum-api/src/main/java/org/apache/continuum/task...
Date Thu, 18 Dec 2008 10:42:27 GMT
Author: oching
Date: Thu Dec 18 02:42:25 2008
New Revision: 727691

URL: http://svn.apache.org/viewvc?rev=727691&view=rev
Log:
o code cleanup
o fixed table for viewing of queued & currently executing tasks

Modified:
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/AbstractBuildQueueAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
    continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.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=727691&r1=727690&r2=727691&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 Thu Dec 18 02:42:25 2008
@@ -313,8 +313,6 @@
      * Checks whether a build is in progress.
      * 
      * @return
-     * @throws BuildManagerException
      */
-    boolean isBuildInProgress()
-        throws BuildManagerException;
+    boolean isBuildInProgress();
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/configuration/GeneralConfiguration.java Thu Dec 18 02:42:25 2008
@@ -42,7 +42,7 @@
     
     private File releaseOutputDirectory;
     
-    private int numberOfBuildsInParallel;
+    private int numberOfBuildsInParallel = 1;
 
     public GeneralConfiguration()
     {

Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java Thu Dec 18 02:42:25 2008
@@ -236,9 +236,17 @@
     void removeProjectsFromBuildQueueWithHashCodes( int[] hashCodes )
         throws TaskQueueException;
     
-    //void setContainer( PlexusContainer container );
-    
+    /**
+     * Returns the build task queue executor used.
+     * 
+     * @return
+     */
     TaskQueueExecutor getBuildTaskQueueExecutor();
     
+    /**
+     * Returns the checkout task queue executor used.
+     * 
+     * @return
+     */
     TaskQueueExecutor getCheckoutTaskQueueExecutor();
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java Thu Dec 18 02:42:25 2008
@@ -1,69 +1,35 @@
 package org.apache.continuum.taskqueue.manager;
 
-import java.util.List;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.taskqueue.TaskQueue;
-import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
+import org.codehaus.plexus.taskqueue.TaskQueue;;
 
 /**
  * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a>
  */
 public interface TaskQueueManager
-{    
-    //TODO: 
-    // - Remove all methods concerning the checkout, prepare build and build queues!!!
-    // - Point all objects using these methods to the "overall" build queue!    
-    
+{            
     String ROLE = TaskQueueManager.class.getName();
 
-    boolean buildInProgress()
-        throws TaskQueueManagerException;
-
-    //void cancelBuildTask( int projectId )
-    //    throws TaskQueueManagerException;
-
-    boolean cancelCurrentBuild()
-        throws TaskQueueManagerException;
-
-    //TaskQueue getBuildQueue();
-
-    TaskQueueExecutor getBuildTaskQueueExecutor()
-        throws TaskQueueManagerException;
-
-    TaskQueue getCheckoutQueue();
-
-    List /* CheckOutTask */getCheckOutTasksInQueue()
-        throws TaskQueueManagerException;
-
-    //int getCurrentProjectIdBuilding()
-     //   throws TaskQueueManagerException;
-
-    //TaskQueue getPrepareBuildQueue();
-
-    TaskQueueExecutor getPrepareBuildTaskQueueExecutor()
-        throws TaskQueueManagerException;
-
-    public List<BuildProjectTask> getProjectsInBuildQueue()
-        throws TaskQueueManagerException;
-
     TaskQueue getPurgeQueue();
 
-    //boolean isInBuildingQueue( int projectId )
-      //  throws TaskQueueManagerException;
-
-    //boolean isInBuildingQueue( int projectId, int buildDefinitionId )
-      //  throws TaskQueueManagerException;
-
-    //boolean isInCheckoutQueue( int projectId )
-     //   throws TaskQueueManagerException;
-
-    //boolean isInCurrentPrepareBuildTask( int projectId )
-      //  throws TaskQueueManagerException;
-
-    //boolean isInPrepareBuildQueue( int projectId )
-      //  throws TaskQueueManagerException;
-
     boolean isInPurgeQueue( int purgeConfigurationId )
         throws TaskQueueManagerException;
 
@@ -90,9 +56,6 @@
     boolean releaseInProgress()
         throws TaskQueueManagerException;
 
-    //boolean removeFromBuildingQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
-      //  throws TaskQueueManagerException;
-
     /**
      * Remove local repository from the purge queue
      * 
@@ -113,25 +76,6 @@
     boolean removeFromPurgeQueue( int[] purgeConfigIds )
         throws TaskQueueManagerException;
 
-//    boolean removeProjectFromBuildingQueue( int projectId )
-  //      throws TaskQueueManagerException;
-
-    //boolean removeProjectsFromBuildingQueue( int[] projectsId )
-      //  throws TaskQueueManagerException;
-
-    /**
-     * @param hashCodes BuildProjectTask hashCodes
-     * @throws TaskQueueManagerException
-     */
-    void removeProjectsFromBuildingQueueWithHashCodes( int[] hashCodes )
-        throws TaskQueueManagerException;
-
-    boolean removeProjectFromCheckoutQueue( int projectId )
-        throws TaskQueueManagerException;
-
-    boolean removeProjectsFromCheckoutQueue( int[] projectId )
-        throws TaskQueueManagerException;
-
     /**
      * Remove local repository from the purge queue
      * 
@@ -140,11 +84,4 @@
      */
     void removeRepositoryFromPurgeQueue( int repositoryId )
         throws TaskQueueManagerException;
-
-    /**
-     * @param hashCodes CheckOutTask hashCodes
-     * @throws TaskQueueManagerException
-     */
-    void removeTasksFromCheckoutQueueWithHashCodes( int[] hashCodes )
-        throws TaskQueueManagerException;
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Thu Dec 18 02:42:25 2008
@@ -32,7 +32,6 @@
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
-import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -45,7 +44,6 @@
 import org.apache.maven.continuum.profile.ProfileService;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
-import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 
 /**

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=727691&r1=727690&r2=727691&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 Thu Dec 18 02:42:25 2008
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -90,6 +89,9 @@
 
     private PlexusContainer container;
 
+    /**
+     * @see BuildsManager#buildProject(int, BuildDefinition, String, int)
+     */
     public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, int trigger )
         throws BuildManagerException
     {
@@ -106,12 +108,7 @@
             throw new BuildManagerException( "Error occurred while checking if the project is already in queue: " +
                 e.getMessage() );
         }
-
-        List<BuildQueue> buildQueues = buildDefinition.getSchedule().getBuildQueues();
-        for( BuildQueue buildQueue : buildQueues )
-        {
-            log.info( "[Build Project]++++++build queue : " + buildQueue.getId() + " - " + buildQueue.getName() );
-        }
+        
         OverallBuildQueue overallBuildQueue =
             getOverallBuildQueue( projectId, BUILD_QUEUE, buildDefinition.getSchedule().getBuildQueues() );
 
@@ -125,8 +122,7 @@
             new BuildProjectTask( projectId, buildDefinition.getId(), trigger, projectName, buildDefinitionLabel );
         try
         {
-            log.info( "++++++[Build] Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() +
-                "'." );
+            log.info( "Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() + "'." );
             overallBuildQueue.addToBuildQueue( buildTask );
         }
         catch ( TaskQueueException e )
@@ -135,6 +131,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#buildProjects(List, Map, int)
+     */
     public void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap,
                                int trigger )
         throws BuildManagerException
@@ -160,14 +159,7 @@
 
         if ( firstProjectId != 0 )
         {
-            BuildDefinition buildDef = projectsBuildDefinitionsMap.get( firstProjectId );
-            List<BuildQueue> buildQueues = buildDef.getSchedule().getBuildQueues();
-            for( BuildQueue buildQueue : buildQueues )
-            {
-                log.info( "[Build Projects]++++++BUILD QUEUE from projectsBuildDefinitionsMap : " + 
-                          buildQueue.getId() + " - " + buildQueue.getName() );
-            }
-            
+            BuildDefinition buildDef = projectsBuildDefinitionsMap.get( firstProjectId ); 
             OverallBuildQueue overallBuildQueue =
                 getOverallBuildQueue( firstProjectId, BUILD_QUEUE, buildDef.getSchedule().getBuildQueues() );
 
@@ -204,7 +196,7 @@
 
                     try
                     {
-                        log.info( "++++++[Build Projects] Project '" + project.getId() + "' - '" + project.getName() +
+                        log.info( "Project '" + project.getId() + "' - '" + project.getName() +
                             "' added to overall build queue '" + overallBuildQueue.getName() + "'." );
                         
                         overallBuildQueue.addToBuildQueue( buildTask );
@@ -224,6 +216,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#cancelBuildInQueue(int)
+     */
     public boolean cancelBuildInQueue( int buildQueueId )
         throws BuildManagerException
     {
@@ -244,6 +239,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#cancelAllBuilds()
+     */
     public boolean cancelAllBuilds()
         throws BuildManagerException
     {
@@ -261,6 +259,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#cancelAllCheckouts()
+     */
     public boolean cancelAllCheckouts()
         throws BuildManagerException
     {
@@ -268,6 +269,9 @@
         return false;
     }
 
+    /**
+     * @see BuildsManager#cancelBuild(int)
+     */
     public boolean cancelBuild( int projectId )
         throws BuildManagerException
     {
@@ -292,17 +296,18 @@
         return true;
     }
 
+    /**
+     * @see BuildsManager#cancelCheckout(int)
+     */
     public boolean cancelCheckout( int projectId )
         throws BuildManagerException
     {
-        // TODO: should this be permitted? (might need to execute svn cleanup?)
-
         try
         {
             OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, CHECKOUT_QUEUE );
             if ( overallBuildQueue != null )
             {
-                //overallBuildQueue.getCheckoutQueue()
+                overallBuildQueue.getCheckoutTaskQueueExecutor().getCurrentTask();
             }
             else
             {
@@ -317,6 +322,9 @@
         return true;
     }
 
+    /**
+     * @see BuildsManager#checkoutProject(int, String, File, String, String, BuildDefinition)
+     */
     public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmUsername,
                                  String scmPassword, BuildDefinition defaultBuildDefinition )
         throws BuildManagerException
@@ -338,18 +346,11 @@
         OverallBuildQueue overallBuildQueue =
             getOverallBuildQueue( projectId, CHECKOUT_QUEUE, defaultBuildDefinition.getSchedule().getBuildQueues() );
         
-        List<BuildQueue> buildQueues = defaultBuildDefinition.getSchedule().getBuildQueues();
-        for( BuildQueue buildQueue : buildQueues )
-        {
-            log.info( "++++++build queue : " + buildQueue.getId() + " - " + buildQueue.getName() );
-        }
-        
         CheckOutTask checkoutTask =
             new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword );
         try
         {
-            log.info( "++++++[Checkout] Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() +
-                "'." );
+            log.info( "Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() + "'." );
             overallBuildQueue.addToCheckoutQueue( checkoutTask );
         }
         catch ( TaskQueueException e )
@@ -358,6 +359,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#isInAnyBuildQueue(int)
+     */
     public boolean isInAnyBuildQueue( int projectId )
         throws BuildManagerException
     {
@@ -371,6 +375,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#isInAnyBuildQueue(int, int)
+     */
     public boolean isInAnyBuildQueue( int projectId, int buildDefinitionId )
         throws BuildManagerException
     {
@@ -384,6 +391,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#isInAnyCheckoutQueue(int)
+     */
     public boolean isInAnyCheckoutQueue( int projectId )
         throws BuildManagerException
     {
@@ -397,6 +407,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#isInPrepareBuildQueue(int)
+     */
     public boolean isInPrepareBuildQueue( int projectId )
         throws BuildManagerException
     {
@@ -429,6 +442,9 @@
         return false;
     }
 
+    /**
+     * @see BuildsManager#isProjectInAnyCurrentBuild(int)
+     */
     public boolean isProjectInAnyCurrentBuild( int projectId )
         throws BuildManagerException
     {
@@ -448,12 +464,16 @@
         }
     }
 
+    /**
+     * @see BuildsManager#prepareBuildProjects(Map, int)
+     */
     public void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger )
         throws BuildManagerException
     {
         try
         {
             PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, trigger );
+            log.info( "Queueing prepare-build-project task '" + task + "' to prepare-build queue." );
             prepareBuildQueue.put( task );
         }
         catch ( TaskQueueException e )
@@ -463,6 +483,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectFromBuildQueue(int)
+     */
     public void removeProjectFromBuildQueue( int projectId )
         throws BuildManagerException
     {
@@ -486,6 +509,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectFromBuildQueue(int, int, int, String)
+     */
     public void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
         throws BuildManagerException
     {
@@ -509,6 +535,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectFromCheckoutQueue(int)
+     */
     public void removeProjectFromCheckoutQueue( int projectId )
         throws BuildManagerException
     {
@@ -532,6 +561,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectsFromBuildQueue(int[])
+     */
     public void removeProjectsFromBuildQueue( int[] projectIds )
     {
         for ( int i = 0; i < projectIds.length; i++ )
@@ -558,6 +590,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectsFromCheckoutQueue(int[])
+     */
     public void removeProjectsFromCheckoutQueue( int[] projectIds )
     {
         for ( int i = 0; i < projectIds.length; i++ )
@@ -584,6 +619,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectsFromCheckoutQueueWithHashcodes(int[])
+     */
     public void removeProjectsFromCheckoutQueueWithHashcodes( int[] hashcodes )
         throws BuildManagerException
     {
@@ -605,6 +643,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeProjectsFromBuildQueueWithHashcodes(int[])
+     */
     public void removeProjectsFromBuildQueueWithHashcodes( int[] hashcodes )
         throws BuildManagerException
     {
@@ -626,6 +667,9 @@
         }
     }
     
+    /**
+     * @see BuildsManager#addOverallBuildQueue(BuildQueue)
+     */
     public void addOverallBuildQueue( BuildQueue buildQueue )
         throws BuildManagerException
     {
@@ -654,6 +698,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#removeOverallBuildQueue(int)
+     */
     public void removeOverallBuildQueue( int overallBuildQueueId )
         throws BuildManagerException
     {
@@ -730,6 +777,9 @@
         return overallBuildQueues;
     }
 
+    /**
+     * @see BuildsManager#getCurrentBuilds()
+     */
     public Map<String, Task> getCurrentBuilds()
         throws BuildManagerException
     {
@@ -750,6 +800,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#getCurrentCheckouts()
+     */
     public Map<String, Task> getCurrentCheckouts()
         throws BuildManagerException
     {
@@ -770,6 +823,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#getProjectsInBuildQueues()
+     */
     public Map<String, List<Task>> getProjectsInBuildQueues()
         throws BuildManagerException
     {
@@ -794,6 +850,9 @@
         }
     }
 
+    /**
+     * @see BuildsManager#getProjectsInCheckoutQueues()
+     */
     public Map<String, List<Task>> getProjectsInCheckoutQueues()
         throws BuildManagerException
     {
@@ -818,6 +877,9 @@
         }
     }
     
+    /**
+     * @see BuildsManager#cancelAllPrepareBuilds()
+     */
     public boolean cancelAllPrepareBuilds() throws BuildManagerException
     {
         try
@@ -837,11 +899,24 @@
         return false;
     }
 
+    /**
+     * @see BuildsManager#isBuildInProgress()
+     */
     public boolean isBuildInProgress()
-        throws BuildManagerException
     {        
-        //TODO!
-        return false;
+        synchronized( overallBuildQueues )
+        {
+            Set<Integer> keySet = overallBuildQueues.keySet();
+            for( Integer key : keySet )
+            {
+                OverallBuildQueue overallBuildQueue = overallBuildQueues.get( key );
+                if( overallBuildQueue.getBuildTaskQueueExecutor().getCurrentTask() != null )
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
     }
 
     private boolean isInQueue( int projectId, int typeOfQueue, int buildDefinitionId )

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java Thu Dec 18 02:42:25 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
 import org.apache.continuum.model.repository.LocalRepository;
@@ -27,11 +28,6 @@
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
 import org.apache.maven.continuum.model.project.Schedule;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 
 import java.util.List;
@@ -62,6 +58,11 @@
      */
     private TaskQueueManager taskQueueManager;
     
+    /**
+     * @plexus.requirement role-hint="parallel"
+     */
+    private BuildsManager parallelBuildsManager;
+    
     public void purge( Schedule schedule )
         throws ContinuumPurgeManagerException
     {
@@ -129,7 +130,7 @@
             else if ( "buildOutput".equals( dirPurge.getDirectoryType() ) )
             {
                 // do not purge if build in progress
-                if ( !taskQueueManager.buildInProgress() && 
+                if ( !parallelBuildsManager.isBuildInProgress() && 
                      !taskQueueManager.isInPurgeQueue( dirPurge.getId() ) )
                 {
                     taskQueueManager.getPurgeQueue().put( new PurgeTask( dirPurge.getId() ) );

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java Thu Dec 18 02:42:25 2008
@@ -427,11 +427,17 @@
         return ( ( ParallelBuildsThreadedTaskQueueExecutor ) buildTaskQueueExecutor ).getQueue();
     }
 
+    /**
+     * @see OverallBuildQueue#getBuildTaskQueueExecutor()
+     */
     public TaskQueueExecutor getBuildTaskQueueExecutor()
     {
         return buildTaskQueueExecutor;
     }
 
+    /**
+     * @see OverallBuildQueue#getCheckoutTaskQueueExecutor()
+     */
     public TaskQueueExecutor getCheckoutTaskQueueExecutor()
     {
         return checkoutTaskQueueExecutor;

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java Thu Dec 18 02:42:25 2008
@@ -1,23 +1,36 @@
 package org.apache.continuum.taskqueue.manager;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 
 import org.apache.commons.lang.ArrayUtils;
-import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
 import org.apache.continuum.purge.PurgeConfigurationService;
 import org.apache.continuum.purge.task.PurgeTask;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
-import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
-import org.apache.maven.continuum.scm.queue.CheckOutTask;
-import org.apache.maven.continuum.scm.queue.PrepareBuildProjectsTask;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
@@ -30,7 +43,6 @@
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
-import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a>
@@ -41,21 +53,6 @@
     implements TaskQueueManager, Contextualizable
 {
     /**
-     * @plexus.requirement role-hint="build-project"
-     */
-    private TaskQueue buildQueue;
-
-    /**
-     * @plexus.requirement role-hint="check-out-project"
-     */
-    private TaskQueue checkoutQueue;
-
-    /**
-     * @plexus.requirement role-hint="prepare-build-project"
-     */
-    private TaskQueue prepareBuildQueue;
-
-    /**
      * @plexus.requirement role-hint="purge"
      */
     private TaskQueue purgeQueue;
@@ -63,11 +60,6 @@
     /**
      * @plexus.requirement
      */
-    private BuildDefinitionDao buildDefinitionDao;
-    
-    /**
-     * @plexus.requirement
-     */
     private ProjectDao projectDao;
 
     /**
@@ -77,263 +69,10 @@
     
     private PlexusContainer container;
 
-    public boolean buildInProgress()
-        throws TaskQueueManagerException
-    {
-        Task task = getCurrentTask( "build-project" );
-    
-        if ( task != null && task instanceof BuildProjectTask )
-        {
-            return true;
-        }
-    
-        return false;
-    }
-    
-    /*public void cancelBuildTask( int projectId )
-        throws TaskQueueManagerException
-    {
-        Task currentTask = getBuildTaskQueueExecutor().getCurrentTask();
-        
-        if ( currentTask instanceof BuildProjectTask )
-        {
-            if ( ( (BuildProjectTask) currentTask ).getProjectId() == projectId )
-            {
-                getLogger().info( "Cancelling task for project " + projectId );
-                getBuildTaskQueueExecutor().cancelTask( currentTask );
-            }
-        }
-    }*/
-
-    public boolean cancelCurrentBuild()
-        throws TaskQueueManagerException
-    {
-        Task task = getBuildTaskQueueExecutor().getCurrentTask();
-        
-        if ( task != null )
-        {
-            if ( task instanceof BuildProjectTask )
-            {
-                getLogger().info( "Cancelling current build task" );
-                return getBuildTaskQueueExecutor().cancelTask( task );
-            }
-            else
-            {
-                getLogger().warn( "Current task not a BuildProjectTask - not cancelling" );
-            }
-        }
-        else
-        {
-            getLogger().warn( "No task running - not cancelling" );
-        }
-        return false;
-    }
-
-    /*public TaskQueue getBuildQueue()
-    {
-        return buildQueue;
-    }
-*/
-    public TaskQueueExecutor getBuildTaskQueueExecutor()
-        throws TaskQueueManagerException
-    {
-        try
-        {
-            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "build-project" );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new TaskQueueManagerException( e.getMessage(), e );
-        }
-    }
-
-    /*public TaskQueueExecutor getCheckoutTaskQueueExecutor()
-        throws TaskQueueManagerException
-    {
-        try
-        {
-            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "check-out-project" );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new TaskQueueManagerException( e.getMessage(), e );
-        }
-    }*/
-
-    public TaskQueue getCheckoutQueue()
-    {
-        return checkoutQueue;
-    }
-    
-    public List<CheckOutTask> getCheckOutTasksInQueue()
-        throws TaskQueueManagerException
-    {
-        try
-        {
-            return checkoutQueue.getQueueSnapshot();
-        }
-        catch ( TaskQueueException e )
-        {
-            throw new TaskQueueManagerException( "Error while getting the checkout queue.", e );
-        }
-    }
-
-    /*public int getCurrentProjectIdBuilding()
-        throws TaskQueueManagerException
-    {
-        Task task = getBuildTaskQueueExecutor().getCurrentTask();
-        if ( task != null )
-        {
-            if ( task instanceof BuildProjectTask )
-            {
-                return ( (BuildProjectTask) task ).getProjectId();
-            }
-        }
-        return -1;
-    }
-
-    public TaskQueue getPrepareBuildQueue()
-    {
-        return prepareBuildQueue;
-    }   */
-
-    public TaskQueueExecutor getPrepareBuildTaskQueueExecutor()
-        throws TaskQueueManagerException
-    {
-        try
-        {
-            return (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class, "prepare-build-project" );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new TaskQueueManagerException( e.getMessage(), e );
-        }
-    }
-
-    public List<BuildProjectTask> getProjectsInBuildQueue()
-        throws TaskQueueManagerException
-    {
-        try
-        {
-            return buildQueue.getQueueSnapshot();
-        }
-        catch ( TaskQueueException e )
-        {
-            throw new TaskQueueManagerException( "Error while getting the building queue.", e );
-        }
-    }
-    
     public TaskQueue getPurgeQueue()
     {
         return purgeQueue;
-    }
-    
-    /*public boolean isInBuildingQueue( int projectId )
-        throws TaskQueueManagerException
-    {
-        return isInBuildingQueue( projectId, -1 );
-    }
-    
-    public boolean isInBuildingQueue( int projectId, int buildDefinitionId )
-        throws TaskQueueManagerException
-    {
-        List<BuildProjectTask> queue = getProjectsInBuildQueue();
-    
-        for ( BuildProjectTask task : queue )
-        {
-            if ( task != null )
-            {
-                if ( buildDefinitionId < 0 )
-                {
-                    if ( task.getProjectId() == projectId )
-                    {
-                        return true;
-                    }
-                }
-                else
-                {
-                    if ( task.getProjectId() == projectId && task.getBuildDefinitionId() == buildDefinitionId )
-                    {
-                        return true;
-                    }
-                }
-            }
-        }
-    
-        return false;
-    }*/
-    
-    /*public boolean isInCheckoutQueue( int projectId )
-        throws TaskQueueManagerException
-    {
-        List<CheckOutTask> queue = getCheckOutTasksInQueue();
-    
-        for ( CheckOutTask task : queue )
-        {
-            if ( task != null && task.getProjectId() == projectId )
-            {
-                return true;
-            }
-        }
-    
-        return false;
-    }
-
-    public boolean isInCurrentPrepareBuildTask( int projectId )
-        throws TaskQueueManagerException
-    {
-        Task task = getPrepareBuildTaskQueueExecutor().getCurrentTask();
-
-        if ( task != null &&  task instanceof PrepareBuildProjectsTask )
-        {
-            Map<Integer, Integer> map = ( (PrepareBuildProjectsTask) task).getProjectsBuildDefinitionsMap();
-            
-            if ( map.size() > 0 )
-            {
-                Set<Integer> projectIds = map.keySet();
-                
-                if ( projectIds.contains( new Integer( projectId ) ) )
-                {
-                    return true;
-                }
-            }
-        }
-        
-        return false;
-    }
-*/    
-    /*public boolean isInPrepareBuildQueue( int projectId )
-        throws TaskQueueManagerException
-    {
-        try
-        {
-            List<PrepareBuildProjectsTask> queue = prepareBuildQueue.getQueueSnapshot();
-            
-            for ( PrepareBuildProjectsTask task : queue )
-            {
-                if ( task != null )
-                {
-                    Map<Integer, Integer> map = ( (PrepareBuildProjectsTask) task).getProjectsBuildDefinitionsMap();
-                    
-                    if ( map.size() > 0 )
-                    {
-                        Set<Integer> projectIds = map.keySet();
-                        
-                        if ( projectIds.contains( new Integer( projectId ) ) )
-                        {
-                            return true;
-                        }
-                    }
-                }
-            }
-            
-            return false;
-        }
-        catch ( TaskQueueException e )
-        {
-            throw new TaskQueueManagerException( "Error while getting the tasks in prepare build queue", e );
-        }
-    }*/
+    }    
     
     public boolean isInPurgeQueue( int purgeConfigId )
         throws TaskQueueManagerException
@@ -406,30 +145,6 @@
         return false;
     }
 
-    /*public boolean removeFromBuildingQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
-        throws TaskQueueManagerException
-    {
-        BuildDefinition buildDefinition;
-        
-        try
-        {
-            buildDefinition = buildDefinitionDao.getBuildDefinition( buildDefinitionId );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new TaskQueueManagerException( "Error while removing project from build queue: " + projectName, e );
-        }
-        
-        String buildDefinitionLabel = buildDefinition.getDescription();
-        if ( StringUtils.isEmpty( buildDefinitionLabel ) )
-        {
-            buildDefinitionLabel = buildDefinition.getGoals();
-        }
-        BuildProjectTask buildProjectTask =
-            new BuildProjectTask( projectId, buildDefinitionId, trigger, projectName, buildDefinitionLabel );
-        return this.buildQueue.remove( buildProjectTask );
-    }*/
-
     public boolean removeFromPurgeQueue( int purgeConfigId )
         throws TaskQueueManagerException
     {
@@ -445,7 +160,6 @@
         return false;
     }
 
-
     public boolean removeFromPurgeQueue( int[] purgeConfigIds )
         throws TaskQueueManagerException
     {
@@ -482,122 +196,6 @@
         return false;
     }
     
-    /*public boolean removeProjectsFromBuildingQueue( int[] projectsId )
-        throws TaskQueueManagerException
-    {
-        if ( projectsId == null )
-        {
-            return false;
-        }
-        if ( projectsId.length < 1 )
-        {
-            return false;
-        }
-        List<BuildProjectTask> queue = getProjectsInBuildQueue();
-    
-        List<BuildProjectTask> tasks = new ArrayList<BuildProjectTask>();
-    
-        for ( BuildProjectTask task : queue )
-        {
-            if ( task != null )
-            {
-                if ( ArrayUtils.contains( projectsId, task.getProjectId() ) )
-                {
-                    tasks.add( task );
-                }
-            }
-        }
-
-        for ( BuildProjectTask buildProjectTask : tasks )
-        {
-            getLogger().info( "cancel build for project " + buildProjectTask.getProjectId() );
-        }
-        if ( !tasks.isEmpty() )
-        {
-            return buildQueue.removeAll( tasks );
-        }
-    
-        return false;
-    }
-    
-    public boolean removeProjectFromBuildingQueue( int projectId )
-        throws TaskQueueManagerException
-    {
-        List<BuildProjectTask> queue = getProjectsInBuildQueue();
-    
-        for ( BuildProjectTask task : queue )
-        {
-            if ( task != null && task.getProjectId() == projectId )
-            {
-                return buildQueue.remove( task );
-            }
-        }
-    
-        return false;
-    }*/
-    
-    public boolean removeProjectsFromCheckoutQueue( int[] projectsId )
-        throws TaskQueueManagerException
-    {
-        if ( projectsId == null )
-        {
-            return false;
-        }
-        if ( projectsId.length < 1 )
-        {
-            return false;
-        }
-        List<CheckOutTask> queue = getCheckOutTasksInQueue();
-    
-        List<CheckOutTask> tasks = new ArrayList<CheckOutTask>();
-    
-        for ( CheckOutTask task : queue )
-        {
-            if ( task != null )
-            {
-                if ( ArrayUtils.contains( projectsId, task.getProjectId() ) )
-                {
-                    tasks.add( task );
-                }
-            }
-        }
-        if ( !tasks.isEmpty() )
-        {
-            return checkoutQueue.removeAll( tasks );
-        }
-        return false;
-    }
-    
-    public void removeProjectsFromBuildingQueueWithHashCodes( int[] hashCodes )
-        throws TaskQueueManagerException
-    {
-        List<BuildProjectTask> queue = getProjectsInBuildQueue();
-    
-        for ( BuildProjectTask task : queue )
-        {
-            if ( ArrayUtils.contains( hashCodes, task.hashCode() ) )
-            {
-                buildQueue.remove( task );
-            }
-        }
-    }
-    
-    public boolean removeProjectFromCheckoutQueue( int projectId )
-        throws TaskQueueManagerException
-    {
-        List<CheckOutTask> queue = getCheckOutTasksInQueue();
-    
-        for ( CheckOutTask task : queue )
-        {
-            if ( task != null && task.getProjectId() == projectId )
-            {
-                return checkoutQueue.remove( task );
-            }
-        }
-    
-        return false;
-    }
-    
     public void removeRepositoryFromPurgeQueue( int repositoryId )
         throws TaskQueueManagerException
     {
@@ -610,20 +208,6 @@
         }
     }
 
-    public void removeTasksFromCheckoutQueueWithHashCodes( int[] hashCodes )
-        throws TaskQueueManagerException
-    {
-        List<CheckOutTask> queue = getCheckOutTasksInQueue();
-    
-        for ( CheckOutTask task : queue )
-        {
-            if ( ArrayUtils.contains( hashCodes, task.hashCode() ) )
-            {
-                checkoutQueue.remove( task );
-            }
-        }
-    }
-
     public void contextualize( Context context )
         throws ContextException
     {

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java Thu Dec 18 02:42:25 2008
@@ -65,19 +65,11 @@
         List<Project> projectsToBeBuilt = new ArrayList<Project>();
         int trigger = AbstractContinuumAction.getTrigger( context );
         
-        getLogger().info( "\n--------- create build project tasks action ---------" );
-        
         // update state of each project first
         for( Project project : projects )
-        {
-            getLogger().info( "##### project : " + project.getId() + " - " + project.getName() );
+        {   
             BuildDefinition buildDefinition = projectsBuildDefinitionsMap.get( project.getId() );
-            List<BuildQueue> buildQueues = buildDefinition.getSchedule().getBuildQueues();
-            for( BuildQueue buildQueue : buildQueues )
-            {
-                getLogger().info( "##### build queue : " + buildQueue.getId() + " - " + buildQueue.getName() );
-            }
-
+            
             if ( parallelBuildsManager.isInAnyBuildQueue( project.getId(), buildDefinition.getId() ) )
             {
                 return;

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java Thu Dec 18 02:42:25 2008
@@ -483,35 +483,6 @@
                 //shouldBuild = true;
                 projectsToBeBuilt.add( project );
             }
-
-            // TODO: deng parallel builds.. 
-            // - add those projects which should be built into a list
-            //       and also add the build definition into a map of <projectId,build definition> 
-            // - set these in the context map 
-            // 
-            /*if ( shouldBuild )
-            {
-                try
-                {
-                    Map context = new HashMap();
-                    context.put( AbstractContinuumAction.KEY_PROJECT, project );
-                    context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, buildDefinitionId );
-                    context.put( AbstractContinuumAction.KEY_TRIGGER, trigger );
-                    
-                    getLogger().info( "Performing action create-build-project-task" );
-                    actionManager.lookup( "create-build-project-task" ).execute( context );
-                }
-                catch ( ActionNotFoundException e )
-                {
-                   getLogger().error( "Error looking up action 'build-project'" );
-                   throw new TaskExecutionException( "Error looking up action 'build-project'", e );
-                }
-                catch ( Exception e )
-                {
-                    getLogger().error( e.getMessage(), e );
-                    throw new TaskExecutionException( "Error executing action 'build-project'", e );
-                }
-            }*/
         }
         
         try

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java Thu Dec 18 02:42:25 2008
@@ -64,12 +64,6 @@
         
         BuildsManager buildsManager = (BuildsManager) wac.getBean( PlexusToSpringUtils.buildSpringId( BuildsManager.class, "parallel" ) );
 
-        /*        TaskQueueExecutor buildProject = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
-            .buildSpringId( TaskQueueExecutor.class, "build-project" ) );
-
-        TaskQueueExecutor checkOutProject = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
-            .buildSpringId( TaskQueueExecutor.class, "check-out-project" ) );
-*/
         TaskQueueExecutor prepareRelease = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
             .buildSpringId( TaskQueueExecutor.class, "prepare-release" ) );
 

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractBuildAction.java Thu Dec 18 02:42:25 2008
@@ -18,10 +18,14 @@
  */
 package org.apache.maven.continuum.web.action;
 
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
+import org.codehaus.plexus.taskqueue.Task;
 
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
@@ -30,31 +34,24 @@
  */
 public abstract class AbstractBuildAction
     extends ContinuumConfirmAction
-{
-    
+{    
     private int projectId;
     
     private boolean canDelete = true;
     
-    /**
-     * @plexus.requirement role-hint='build-project'
-     */
-    private TaskQueueExecutor taskQueueExecutor; 
-    
-    
-    
-    protected TaskQueueExecutor getTaskQueueExecutor()
-    {
-        return this.taskQueueExecutor;
-    }
-    
     protected boolean canRemoveBuildResult(BuildResult buildResult)
+        throws BuildManagerException
     {
-        BuildProjectTask buildProjectTask = (BuildProjectTask) getTaskQueueExecutor().getCurrentTask();
-        if ( buildProjectTask != null && buildResult != null )
+        Map<String, Task> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
+        Set<String> keySet = currentBuilds.keySet();
+        for( String key : keySet )
         {
-            return !( buildResult.getState() == ContinuumProjectState.BUILDING && ( buildProjectTask
-                .getBuildDefinitionId() == buildResult.getBuildDefinition().getId() && buildProjectTask.getProjectId() == this.getProjectId() ) );
+            BuildProjectTask buildProjectTask = (BuildProjectTask) currentBuilds.get( key );
+            if ( buildProjectTask != null && buildResult != null )
+            {
+                return !( buildResult.getState() == ContinuumProjectState.BUILDING && ( buildProjectTask
+                    .getBuildDefinitionId() == buildResult.getBuildDefinition().getId() && buildProjectTask.getProjectId() == this.getProjectId() ) );
+            }
         }
         return true;
     }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultAction.java Thu Dec 18 02:42:25 2008
@@ -21,6 +21,7 @@
 
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -62,7 +63,7 @@
     private String projectGroupName = "";
 
     public String execute()
-        throws ContinuumException, ConfigurationException, IOException
+        throws ContinuumException, ConfigurationException, IOException, BuildManagerException
     {
         try
         {

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java Thu Dec 18 02:42:25 2008
@@ -23,6 +23,7 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
@@ -112,13 +113,21 @@
                 {
                     int buildId = Integer.parseInt( id );
 
-                    if ( canRemoveBuildResult( getContinuum().getBuildResult( buildId ) ) )
+                    try
                     {
-                        buildResultsRemovable.add( Integer.toString( buildId ) );
+                        if ( canRemoveBuildResult( getContinuum().getBuildResult( buildId ) ) )
+                        {
+                            buildResultsRemovable.add( Integer.toString( buildId ) );
+                        }
+                        else
+                        {
+                            this.addActionMessage( getResourceBundle().getString( "buildResult.cannot.delete" ) );
+                        }
                     }
-                    else
+                    catch ( BuildManagerException e )
                     {
-                        this.addActionMessage( getResourceBundle().getString( "buildResult.cannot.delete" ) );
+                        getLogger().error( e.getMessage() );
+                        throw new ContinuumException( e.getMessage(), e ); 
                     }
                 }
             }
@@ -186,7 +195,5 @@
     public void setProjectGroupId( int projectGroupId )
     {
         this.projectGroupId = projectGroupId;
-    }
-
-    
+    }    
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/CancelBuildAction.java Thu Dec 18 02:42:25 2008
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.continuum.buildmanager.BuildsManager;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.web.action.admin.AbstractBuildQueueAction;
@@ -36,7 +37,6 @@
 public class CancelBuildAction
     extends AbstractBuildQueueAction
 {
-
     private int projectId;
 
     private int projectGroupId;
@@ -79,11 +79,19 @@
         BuildsManager parallelBuildsManager = getContinuum().getBuildsManager();
         parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );           
         
-        // now we must check if the current build is one of this
-        int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
-        if ( index > 0 )
+        try
+        {
+            // now we must check if the current build is one of this
+            int index = ArrayUtils.indexOf( projectsId, getCurrentProjectIdBuilding() );
+            if ( index > 0 )
+            {
+                cancelBuild( projectsId[index] );
+            }
+        }
+        catch ( BuildManagerException e )
         {
-            cancelBuild( projectsId[index] );
+            getLogger().error( e.getMessage() );
+            throw new ContinuumException( e.getMessage(), e );
         }
         return SUCCESS;
     }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java Thu Dec 18 02:42:25 2008
@@ -80,11 +80,6 @@
      * @plexus.requirement role-hint="default"
      */
     private RoleManager roleManager;
-
-    /**
-     * @plexus.requirement
-     */
-    //private TaskQueueManager taskQueueManager;
     
     /**
      * @plexus.requirement role-hint="parallel"
@@ -351,8 +346,7 @@
             {
                 Project p = (Project) proj.next();
                 try
-                {
-                    //if ( taskQueueManager.isInCheckoutQueue( p.getId() ) )
+                {   
                     if ( parallelBuildsManager.isInAnyCheckoutQueue( p.getId() ) )
                     {
                         projectInCOQueue = true;
@@ -362,10 +356,6 @@
                 {
                     throw new ContinuumException( e.getMessage(), e );
                 }
-                /*catch ( TaskQueueManagerException e )
-                {
-                    throw new ContinuumException( e.getMessage(), e );
-                }*/
                 projects.put( p, new Integer( p.getProjectGroup().getId() ) );
             }
         }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/SummaryAction.java Thu Dec 18 02:42:25 2008
@@ -56,11 +56,6 @@
     private GroupSummary groupSummary = new GroupSummary();
 
     /**
-     * @plexus.requirement
-     */
-    //private TaskQueueManager taskQueueManager;
-    
-    /**
      * @plexus.requirement role-hint="parallel"
      */
     private BuildsManager parallelBuildsManager;
@@ -115,13 +110,11 @@
             model.setProjectType( project.getExecutorId() );
 
             try
-            {
-                //if ( taskQueueManager.isInBuildingQueue( project.getId() ) )
+            {                
                 if ( parallelBuildsManager.isInAnyBuildQueue( project.getId() ) )
                 {
                     model.setInBuildingQueue( true );
-                }
-                //else if ( taskQueueManager.isInCheckoutQueue( project.getId() ) )
+                }             
                 else if ( parallelBuildsManager.isInAnyCheckoutQueue( project.getId() ) )
                 {
                     model.setInCheckoutQueue( true );
@@ -136,10 +129,6 @@
             {
                 throw new ContinuumException( e.getMessage(), e );
             }
-            /*catch ( TaskQueueManagerException e )
-            {
-                throw new ContinuumException( e.getMessage(), e );
-            }*/
 
             model.setState( project.getState() );
 

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/AbstractBuildQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/AbstractBuildQueueAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/AbstractBuildQueueAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/AbstractBuildQueueAction.java Thu Dec 18 02:42:25 2008
@@ -18,12 +18,15 @@
  */
 package org.apache.maven.continuum.web.action.admin;
 
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.web.action.ContinuumActionSupport;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.taskqueue.Task;
-import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
 
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
@@ -34,68 +37,41 @@
     extends ContinuumActionSupport
     implements LogEnabled
 {
-
-    /**
-     * @plexus.requirement role-hint='build-project'
-     */
-    private TaskQueueExecutor taskQueueExecutor;    
-    
     protected boolean cancelBuild( int projectId )
         throws ContinuumException
     {
-        Task task = getTaskQueueExecutor().getCurrentTask();
-
-        if ( task != null )
+        try
         {
-            if ( task instanceof BuildProjectTask )
-            {
-                if ( ( (BuildProjectTask) task ).getProjectId() == projectId )
-                {
-                    getLogger().info( "Cancelling task for project " + projectId );
-                    return getTaskQueueExecutor().cancelTask( task );
-                }
-                else
-                {
-                    getLogger().warn(
-                                      "Current task is not for the given projectId (" + projectId + "): "
-                                          + ( (BuildProjectTask) task ).getProjectId() + "; not cancelling" );
-                }
-            }
-            else
-            {
-                getLogger().warn( "Current task not a BuildProjectTask - not cancelling" );
-            }
+            return getContinuum().getBuildsManager().cancelBuild( projectId );
         }
-        else
+        catch ( BuildManagerException e )
         {
-            getLogger().warn( "No task running - not cancelling" );
+            getLogger().error( e.getMessage() );
+            throw new ContinuumException( e.getMessage(), e );
         }
-        return false;
     }
 
-
     /**
      * @return -1 if not project currently building
      * @throws ContinuumException
      */
     protected int getCurrentProjectIdBuilding()
-        throws ContinuumException
+        throws ContinuumException, BuildManagerException
     {
-        Task task = getTaskQueueExecutor().getCurrentTask();
-        if ( task != null )
+        Map<String, Task> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
+        Set<String> keySet = currentBuilds.keySet();
+        
+        for( String key : keySet )
         {
-            if ( task instanceof BuildProjectTask )
+            Task task = currentBuilds.get( key );
+            if ( task != null )
             {
-                return ( (BuildProjectTask) task ).getProjectId();
+                if ( task instanceof BuildProjectTask )
+                {
+                    return ( (BuildProjectTask) task ).getProjectId();
+                }
             }
-        }
+        }        
         return -1;
     }
-
-
-    public TaskQueueExecutor getTaskQueueExecutor()
-    {
-        return taskQueueExecutor;
-    }    
-    
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ConfigurationAction.java Thu Dec 18 02:42:25 2008
@@ -101,11 +101,8 @@
             releaseOutputDirectory = releaseOutputDirectoryFile.getAbsolutePath();
         }
         
-        //if ( requireParallelBuilds )
-        //{
         numberOfAllowedBuildsinParallel = configuration.getNumberOfBuildsInParallel();	
-        //}
-                
+               
         String requireRelease = ServletActionContext.getRequest().getParameter( "requireReleaseOutput" );
         setRequireReleaseOutput( new Boolean( requireRelease ) );
     }
@@ -134,10 +131,7 @@
 
         configuration.setBuildOutputDirectory( new File( buildOutputDirectory ) );
         
-        //if ( requireParallelBuilds )
-        //{
-            configuration.setNumberOfBuildsInParallel( numberOfAllowedBuildsinParallel );	
-        //}
+        configuration.setNumberOfBuildsInParallel( numberOfAllowedBuildsinParallel );	
         
         if ( StringUtils.isNotEmpty( deploymentRepositoryDirectory ) )
         {

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java Thu Dec 18 02:42:25 2008
@@ -172,10 +172,10 @@
         {
             // queued builds
             Map<String, List<Task>> builds = getContinuum().getBuildsManager().getProjectsInBuildQueues();
-            Set<String> keySet = builds.keySet(); 
-            List<BuildProjectTask> buildTasks = new ArrayList<BuildProjectTask>();
+            Set<String> keySet = builds.keySet();            
             for( String key : keySet )
             {
+                List<BuildProjectTask> buildTasks = new ArrayList<BuildProjectTask>();
                 for( Task task : builds.get( key ) )
                 {
                     BuildProjectTask buildTask = (BuildProjectTask) task;
@@ -211,10 +211,10 @@
         {
             // queued checkouts
             Map<String, List<Task>> checkouts = getContinuum().getBuildsManager().getProjectsInCheckoutQueues();
-            Set<String> keySet = checkouts.keySet(); 
-            List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
+            Set<String> keySet = checkouts.keySet();
             for( String key : keySet )
             {
+                List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
                 for( Task task : checkouts.get( key ) )
                 {
                     CheckOutTask checkoutTask = (CheckOutTask) task;

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp Thu Dec 18 02:42:25 2008
@@ -87,8 +87,8 @@
                 <th>&nbsp;</th>
               </tr>
               <c:forEach var="element" items="${buildsInQueue}">
-                <tr>                  
-                  <c:forEach var="buildTask" items="${element.value}">
+                <c:forEach var="buildTask" items="${element.value}">
+                  <tr>                                    
                     <td width="1%>
                       <redback:ifAuthorized permission="continuum-manage-queues">
                         <input type="checkbox" name="selectedBuildTaskHashCodes" value="${buildTask.hashCode}" />                                      
@@ -110,9 +110,9 @@
                       <redback:elseAuthorized>
                         <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
                       </redback:elseAuthorized>               
-                    </td>
-                  </c:forEach>                  
-                </tr>
+                    </td>                                    
+                  </tr>
+                </c:forEach>
               </c:forEach>
             </tbody>
             </s:if>
@@ -250,8 +250,8 @@
                 <th>&nbsp;</th>
               </tr>
               <c:forEach var="element" items="${checkoutsInQueue}">
-                <tr>                  
-                  <c:forEach var="checkoutTask" items="${element.value}">
+                <c:forEach var="checkoutTask" items="${element.value}">
+                  <tr>
                     <td width="1%>
                       <redback:ifAuthorized permission="continuum-manage-queues">
                         <input type="checkbox" name="selectedCheckOutTaskHashCodes" value="${checkoutTask.hashCode}" />                                      
@@ -269,9 +269,9 @@
                       <redback:elseAuthorized>
                         <img src="<s:url value='/images/cancelbuild_disabled.gif' includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>" border="0">
                       </redback:elseAuthorized>             
-                    </td>
-                  </c:forEach>                  
-                </tr>
+                    </td>                                    
+                  </tr>
+                </c:forEach>
               </c:forEach>
             </tbody>
             </s:if>
@@ -280,6 +280,22 @@
             </s:else>
           </table>
         </div>    
+        <c:if test="${not empty checkoutsInQueue}">
+          <div class="functnbar3">
+            <table>
+              <tbody>
+                <tr>
+                  <td>
+                    <redback:ifAuthorized permission="continuum-manage-queues">
+                    <input type="submit" value="<s:text name="checkoutQueue.removeEntries"/>"
+                           onclick="$('removeForm').action='removeCheckoutQueueEntries!removeCheckoutEntries.action';$('removeForm').submit();" />
+                    </redback:ifAuthorized>
+                  </td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </c:if>
         
         <%--
         <div id="h3">

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp (original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/configurationEdit.jsp Thu Dec 18 02:42:25 2008
@@ -89,7 +89,9 @@
               </p></s:param>
             </s:textfield>
 
+            <%--
             <s:checkbox label="%{getText('configuration.disable.parallel.builds')}" name="requireParallelBuilds" required="true"/>
+            --%>
             
             <s:hidden name="requireReleaseOutput"/>
           </tbody>

Modified: continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=727691&r1=727690&r2=727691&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java Thu Dec 18 02:42:25 2008
@@ -28,8 +28,6 @@
 import org.apache.continuum.purge.ContinuumPurgeManagerException;
 import org.apache.continuum.purge.PurgeConfigurationServiceException;
 import org.apache.continuum.repository.RepositoryServiceException;
-import org.apache.continuum.taskqueue.manager.TaskQueueManager;
-import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
 import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
 import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
 import org.apache.continuum.xmlrpc.repository.LocalRepository;
@@ -61,6 +59,7 @@
 import org.codehaus.plexus.redback.authorization.AuthorizationException;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
+import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.lang.reflect.Field;
@@ -71,6 +70,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -96,11 +96,6 @@
      * @plexus.requirement role-hint="default"
      */
     private RoleManager roleManager;
-
-    /**
-     * @plexus.requirement
-     */
-    private TaskQueueManager taskQueueManager;
     
     /**
      * @plexus.requirement role-hint="parallel"
@@ -1054,28 +1049,35 @@
         try
         {
             return parallelBuildsManager.isInAnyBuildQueue( projectId );
-            //return taskQueueManager.isInBuildingQueue( projectId );
         }
         catch ( BuildManagerException e )
         {
             throw new ContinuumException( e.getMessage(), e );
         }
-        /*catch ( TaskQueueManagerException e )
-        {
-            throw new ContinuumException( e.getMessage(), e );
-        }*/
     }
 
     public List<BuildProjectTask> getProjectsInBuildQueue()
         throws ContinuumException
     {
         try
-        {
-            //TODO: deng parallel builds
-            // implement this!
-            return populateBuildProjectTaskList( taskQueueManager.getProjectsInBuildQueue() );
+        {  
+            Map<String, List<Task>> buildTasks = parallelBuildsManager.getProjectsInBuildQueues();
+            Set<String> keys = buildTasks.keySet();
+            List<org.apache.maven.continuum.buildqueue.BuildProjectTask> convertedTasks =
+                new ArrayList<org.apache.maven.continuum.buildqueue.BuildProjectTask>();
+            
+            for( String key : keys )
+            {
+                List<Task> tasks = buildTasks.get( key );
+                for( Task task : tasks )
+                {
+                    convertedTasks.add( ( org.apache.maven.continuum.buildqueue.BuildProjectTask ) task );
+                }
+            }
+            
+            return populateBuildProjectTaskList( convertedTasks );
         }
-        catch ( TaskQueueManagerException e )
+        catch ( BuildManagerException e )
         {
             throw new ContinuumException( e.getMessage(), e );
         }
@@ -1087,7 +1089,6 @@
         checkManageQueuesAuthorization();
         
         parallelBuildsManager.removeProjectsFromBuildQueue( projectsId );
-        //taskQueueManager.removeProjectsFromBuildingQueue( projectsId );
         
         return 0;
     }
@@ -1098,11 +1099,9 @@
         checkManageQueuesAuthorization();
         try
         {
-            // TODO: deng parallel builds
-            // - implement this in BuildsManager!
-            return taskQueueManager.cancelCurrentBuild();
+            return parallelBuildsManager.cancelAllBuilds();
         }
-        catch ( TaskQueueManagerException e )
+        catch ( BuildManagerException e )
         {
             throw new ContinuumException( e.getMessage(), e );
         }



Mime
View raw message