continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r727898 - in /continuum/branches/continuum-parallel-builds: continuum-core/src/main/java/org/apache/continuum/buildmanager/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-webapp/src/main/java/org/apache/maven/continuum/w...
Date Fri, 19 Dec 2008 02:29:22 GMT
Author: oching
Date: Thu Dec 18 18:29:22 2008
New Revision: 727898

URL: http://svn.apache.org/viewvc?rev=727898&view=rev
Log:
o create and start all existing build queues in the database during startup
o do not allow deletion of build queue which is currently executing a checkout or build task

Modified:
    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/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/struts.xml

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=727898&r1=727897&r2=727898&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 18:29:22 2008
@@ -27,6 +27,7 @@
 import java.util.Set;
 
 import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildQueueDao;
 import org.apache.continuum.taskqueue.OverallBuildQueue;
 import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
@@ -86,6 +87,11 @@
      * @plexus.requirement
      */
     private ConfigurationService configurationService;
+    
+    /**
+     * @plexus.requirement
+     */
+    private BuildQueueDao buildQueueDao;
 
     private PlexusContainer container;
 
@@ -1086,22 +1092,26 @@
         {
             try
             {
-                BuildQueue defaultBuildQueue = configurationService.getDefaultBuildQueue();
-
-                OverallBuildQueue defaultOverallBuildQueue =
-                    (OverallBuildQueue) container.lookup( OverallBuildQueue.class );
-                defaultOverallBuildQueue.setId( defaultBuildQueue.getId() );
-                defaultOverallBuildQueue.setName( defaultBuildQueue.getName() );
-
-                overallBuildQueues.put( defaultOverallBuildQueue.getId(), defaultOverallBuildQueue
);
+                // create all the build queues configured in the database, not just the default!
+                List<BuildQueue> buildQueues = buildQueueDao.getAllBuildQueues();
+                for( BuildQueue buildQueue : buildQueues )
+                {
+                    OverallBuildQueue defaultOverallBuildQueue =
+                        (OverallBuildQueue) container.lookup( OverallBuildQueue.class );
+                    defaultOverallBuildQueue.setId( buildQueue.getId() );
+                    defaultOverallBuildQueue.setName( buildQueue.getName() );
+
+                    overallBuildQueues.put( defaultOverallBuildQueue.getId(), defaultOverallBuildQueue
);
+                }               
+                //BuildQueue defaultBuildQueue = configurationService.getDefaultBuildQueue();
             }
             catch ( ComponentLookupException e )
             {
-                log.error( "Cannot add default build queue: " + e.getMessage() );
+                log.error( "Cannot create overall build queue: " + e.getMessage() );
             }
             catch ( ContinuumStoreException e )
             {
-                log.error( "Cannot add default build queue: " + e.getMessage() );
+                log.error( "Cannot create overall build queue: " + e.getMessage() );
             }
         }
     }

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=727898&r1=727897&r2=727898&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Dec 18 18:29:22 2008
@@ -3241,7 +3241,7 @@
         }
         catch ( ContinuumStoreException e )
         {
-            throw new ContinuumException( "Error adding build queue.", e );
+            throw new ContinuumException( "Error adding build queue to the database.", e
);
         }
     }
     
@@ -3277,7 +3277,7 @@
         }
         catch ( ContinuumStoreException e )
         {
-            throw new ContinuumException( "Error deleting build queue.", e );
+            throw new ContinuumException( "Error deleting build queue from database.", e
);
         }
     }
     

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java?rev=727898&r1=727897&r2=727898&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
Thu Dec 18 18:29:22 2008
@@ -41,6 +41,8 @@
     private List<BuildQueue> buildQueueList;
 
     private BuildQueue buildQueue;
+    
+    private String message;
 
     public void prepare()
         throws ContinuumException
@@ -119,26 +121,12 @@
 
     public String delete()
         throws Exception
-    {
-        try
-        {
-            BuildQueue buildQueueToBeDeleted = getContinuum().getBuildQueue( this.buildQueue.getId()
);
-            getContinuum().getBuildsManager().removeOverallBuildQueue( buildQueueToBeDeleted.getId()
);
-            getContinuum().removeBuildQueue( buildQueueToBeDeleted );
-
-            this.buildQueueList = getContinuum().getAllBuildQueues();
-        }
-        catch ( BuildManagerException e )
-        {
-            addActionError( "Cannot delete overall build queue: " + e.getMessage() );
-            return ERROR;
-        }
-        catch ( ContinuumException e )
-        {
-            addActionError( "Cannot delete build queue from the database: " + e.getMessage()
);
-            return ERROR;
-        }
+    {        
+        BuildQueue buildQueueToBeDeleted = getContinuum().getBuildQueue( this.buildQueue.getId()
);
+        getContinuum().getBuildsManager().removeOverallBuildQueue( buildQueueToBeDeleted.getId()
);
+        getContinuum().removeBuildQueue( buildQueueToBeDeleted );
 
+        this.buildQueueList = getContinuum().getAllBuildQueues();
         return SUCCESS;
     }
 
@@ -181,4 +169,14 @@
     {
         this.buildQueue = buildQueue;
     }
+
+    public String getMessage()
+    {
+        return message;
+    }
+
+    public void setMessage( String message )
+    {
+        this.message = message;
+    }
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=727898&r1=727897&r2=727898&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
Thu Dec 18 18:29:22 2008
@@ -798,7 +798,7 @@
 buildDefinitionTemplate.builddefinitions.define = Configure the used Build Definitions
 
 # ----------------------------------------------------------------------
-# Page: Build Queue
+# Page: Queues
 # ----------------------------------------------------------------------
 buildQueue.page.title = Continuum - Build Queue
 buildQueue.section.title = Continuum - Build Queue
@@ -818,6 +818,12 @@
 checkoutQueue.removeEntries = Cancel Entries
 
 # ----------------------------------------------------------------------
+# Page: Build Queue
+# ----------------------------------------------------------------------
+buildQueue.cannot.delete = Cannot delete build queue, task is currently executing.
+buildQueue.delete.error = Unable to delete build queue from the database.
+
+# ----------------------------------------------------------------------
 # Page: Confirm Delete BuildResult(s)
 # ----------------------------------------------------------------------
 buildResult.delete.confirmation.page.title = Continuum - Delete Build Results

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/struts.xml?rev=727898&r1=727897&r2=727898&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/struts.xml
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/resources/struts.xml
Thu Dec 18 18:29:22 2008
@@ -782,7 +782,7 @@
     </action>    
     
     <!--
-    * ALLOWED BUILDS IN PARALLEL
+    * Build Queue (Parallel Builds)
     -->
     
     <action name="buildQueueList" class="org.apache.maven.continuum.web.action.admin.BuildQueueAction"
method="list">
@@ -801,7 +801,7 @@
     
     <action name="deleteBuildQueue" class="org.apache.maven.continuum.web.action.admin.BuildQueueAction"
method="delete">
       <result name="input">/WEB-INF/jsp/admin/parallelbuilds.jsp</result>
-      <result name="success">/WEB-INF/jsp/admin/parallelbuilds.jsp</result>
+      <result name="success">/WEB-INF/jsp/admin/parallelbuilds.jsp</result> 
  
     </action>  
         
     <!--



Mime
View raw message