continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r731853 - in /continuum/branches/continuum-parallel-builds: continuum-api/src/main/java/org/apache/continuum/buildqueue/ continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-commons/src/main/java/org/apache/maven/...
Date Tue, 06 Jan 2009 07:17:06 GMT
Author: oching
Date: Mon Jan  5 23:17:06 2009
New Revision: 731853

URL: http://svn.apache.org/viewvc?rev=731853&view=rev
Log:
fix FX constraint violation when deleting build queue

Added:
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueService.java
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueServiceException.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildqueue/
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildqueue/DefaultBuildQueueService.java
Modified:
    continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    continuum/branches/continuum-parallel-builds/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
    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-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
    continuum/branches/continuum-parallel-builds/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java

Added: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueService.java?rev=731853&view=auto
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueService.java
(added)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueService.java
Mon Jan  5 23:17:06 2009
@@ -0,0 +1,48 @@
+package org.apache.continuum.buildqueue;
+
+/*
+ * 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.List;
+
+import org.apache.maven.continuum.model.project.BuildQueue;
+
+/**
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ */
+public interface BuildQueueService
+{
+    BuildQueue addBuildQueue( BuildQueue buildQueue )
+        throws BuildQueueServiceException;
+
+    void removeBuildQueue( BuildQueue buildQueue )
+        throws BuildQueueServiceException;
+
+    BuildQueue getBuildQueue( int buildQueueId )
+        throws BuildQueueServiceException;
+
+    BuildQueue getBuildQueueByName( String buildQueueName )
+        throws BuildQueueServiceException;
+
+    BuildQueue updateBuildQueue( BuildQueue buildQueue )
+        throws BuildQueueServiceException;
+
+    List<BuildQueue> getAllBuildQueues()
+        throws BuildQueueServiceException;
+}

Added: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueServiceException.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueServiceException.java?rev=731853&view=auto
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueServiceException.java
(added)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildqueue/BuildQueueServiceException.java
Mon Jan  5 23:17:06 2009
@@ -0,0 +1,44 @@
+package org.apache.continuum.buildqueue;
+
+/*
+ * 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.
+ */
+
+/**
+ * 
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ *
+ */
+public class BuildQueueServiceException
+    extends Exception
+{
+    public BuildQueueServiceException( String message )
+    {
+        super( message );
+    }
+    
+    public BuildQueueServiceException( Throwable cause )
+    {
+        super( cause );
+    }
+    
+    public BuildQueueServiceException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}

Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?rev=731853&r1=731852&r2=731853&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
Mon Jan  5 23:17:06 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.maven.continuum.model.project.BuildQueue;
 import org.apache.maven.continuum.model.project.Schedule;
@@ -92,7 +93,7 @@
     void setNumberOfBuildsInParallel( int num );
     
     BuildQueue getDefaultBuildQueue()
-        throws ContinuumStoreException;
+        throws BuildQueueServiceException;
 
     // ----------------------------------------------------------------------
     //
@@ -113,5 +114,5 @@
         throws ConfigurationStoringException, ContinuumConfigurationException;
 
     Schedule getDefaultSchedule()
-        throws ContinuumStoreException, ConfigurationLoadingException, ContinuumConfigurationException;
+        throws ContinuumStoreException, ConfigurationLoadingException, ContinuumConfigurationException,
BuildQueueServiceException;
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=731853&r1=731852&r2=731853&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
Mon Jan  5 23:17:06 2009
@@ -19,10 +19,11 @@
  * under the License.
  */
 
+import org.apache.continuum.buildqueue.BuildQueueService;
+import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.configuration.ContinuumConfiguration;
 import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.continuum.configuration.GeneralConfiguration;
-import org.apache.continuum.dao.BuildQueueDao;
 import org.apache.continuum.dao.ScheduleDao;
 import org.apache.continuum.dao.SystemConfigurationDao;
 import org.apache.maven.continuum.model.project.BuildQueue;
@@ -62,11 +63,11 @@
      * @plexus.requirement
      */
     private SystemConfigurationDao systemConfigurationDao;
-    
+        
     /**
      * @plexus.requirement
      */
-    private BuildQueueDao buildQueueDao;
+    private BuildQueueService buildQueueService;
 
     /**
      * @plexus.requirement
@@ -103,16 +104,16 @@
         this.scheduleDao = scheduleDao;
     }
     
-    public BuildQueueDao getBuildQueueDao()
+    public BuildQueueService getBuildQueueService()
     {
-        return buildQueueDao;
+        return buildQueueService;
     }
-    
-    public void setBuildQueueDao( BuildQueueDao buildQueueDao )
+
+    public void setBuildQueueService( BuildQueueService buildQueueService )
     {
-        this.buildQueueDao = buildQueueDao;
+        this.buildQueueService = buildQueueService;
     }
-
+    
     public SystemConfigurationDao getSystemConfigurationDao()
     {
         return systemConfigurationDao;
@@ -498,7 +499,7 @@
     }
 
     public Schedule getDefaultSchedule()
-        throws ContinuumStoreException, ConfigurationLoadingException, ContinuumConfigurationException
+        throws ContinuumStoreException, ConfigurationLoadingException, ContinuumConfigurationException,
BuildQueueServiceException
     {
         // Schedule
         Schedule defaultSchedule = scheduleDao.getScheduleByName( DEFAULT_SCHEDULE_NAME );
@@ -514,15 +515,15 @@
     }
     
     public BuildQueue getDefaultBuildQueue()
-        throws ContinuumStoreException
+        throws BuildQueueServiceException
     {     
-        BuildQueue defaultBuildQueue = buildQueueDao.getBuildQueueByName( DEFAULT_BUILD_QUEUE_NAME
);
+        BuildQueue defaultBuildQueue = buildQueueService.getBuildQueueByName( DEFAULT_BUILD_QUEUE_NAME
);
     
         if ( defaultBuildQueue == null )
         {
             defaultBuildQueue = createDefaultBuildQueue();
-    
-            defaultBuildQueue = buildQueueDao.addBuildQueue( defaultBuildQueue );
+            
+            defaultBuildQueue = buildQueueService.addBuildQueue( defaultBuildQueue );
         }
     
         return defaultBuildQueue;
@@ -533,7 +534,7 @@
     // ----------------------------------------------------------------------
 
     private Schedule createDefaultSchedule()
-        throws ConfigurationLoadingException, ContinuumConfigurationException, ContinuumStoreException
+        throws ConfigurationLoadingException, ContinuumConfigurationException, ContinuumStoreException,
BuildQueueServiceException
     {
 
         log.info( "create Default Schedule" );

Modified: continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml?rev=731853&r1=731852&r2=731853&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
Mon Jan  5 23:17:06 2009
@@ -29,7 +29,7 @@
     <property name="scheduleDao" ref="scheduleDao"/>
     <property name="systemConfigurationDao" ref="systemConfigurationDao"/>
     <property name="configuration" ref="continuumConfiguration"/>
-    <property name="buildQueueDao" ref="buildQueueDao"/>
+    <property name="buildQueueService" ref="buildQueueService"/>
   </bean>
   <bean id="workingDirectoryService" class="org.apache.maven.continuum.utils.DefaultWorkingDirectoryService">
     <property name="configurationService" ref="configurationService"/>

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=731853&r1=731852&r2=731853&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
Mon Jan  5 23:17:06 2009
@@ -26,8 +26,9 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.continuum.buildqueue.BuildQueueService;
+import org.apache.continuum.buildqueue.BuildQueueServiceException;
 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;
@@ -87,11 +88,11 @@
      * @plexus.requirement
      */
     private ConfigurationService configurationService;
-    
+        
     /**
      * @plexus.requirement
      */
-    private BuildQueueDao buildQueueDao;
+    private BuildQueueService buildQueueService;
 
     private PlexusContainer container;
     
@@ -720,7 +721,7 @@
         List<CheckOutTask> checkoutTasks = null;
 
         synchronized ( overallBuildQueues )
-        {
+        {                        
             OverallBuildQueue overallBuildQueue = overallBuildQueues.get( overallBuildQueueId
);
             if ( overallBuildQueue.getName().equals( ConfigurationService.DEFAULT_BUILD_QUEUE_NAME
) )
             {
@@ -764,30 +765,42 @@
             }
 
             this.overallBuildQueues.remove( overallBuildQueueId );
+            log.info( "Removed overall build queue '" + overallBuildQueueId + "' from build
queues map." );
         }
 
-        try
-        {
-            for ( Task task : tasks )
+        
+        for ( Task task : tasks )
+        {            
+            BuildProjectTask buildTask = (BuildProjectTask) task;
+            try
             {
-                BuildProjectTask buildTask = (BuildProjectTask) task;
                 BuildDefinition buildDefinition =
                     buildDefinitionDao.getBuildDefinition( buildTask.getBuildDefinitionId()
);
+            
                 buildProject( buildTask.getProjectId(), buildDefinition, buildTask.getProjectName(),
                               buildTask.getTrigger() );
             }
+            catch ( ContinuumStoreException e )
+            {
+                log.error( "Unable to queue build task for project '" + buildTask.getProjectName()
+ "'" );
+                continue;
+            }
+        }
 
-            for ( CheckOutTask task : checkoutTasks )
+        for ( CheckOutTask task : checkoutTasks )
+        {
+            try
             {
                 BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition(
task.getProjectId() );
                 checkoutProject( task.getProjectId(), task.getProjectName(), task.getWorkingDirectory(),
-                                 task.getScmUserName(), task.getScmPassword(), buildDefinition
);
+                                 task.getScmUserName(), task.getScmPassword(), buildDefinition
);            
             }
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new BuildManagerException( "Cannot remove build queue: " + e.getMessage()
);
-        }
+            catch ( ContinuumStoreException e )
+            {
+                log.error( "Unable to queue checkout task for project '" + task.getProjectName()
+ "'" );
+                continue;
+            }
+        }        
     }
 
     public Map<Integer, OverallBuildQueue> getOverallBuildQueues()
@@ -1111,8 +1124,8 @@
         {
             try
             {
-                // create all the build queues configured in the database, not just the default!
-                List<BuildQueue> buildQueues = buildQueueDao.getAllBuildQueues(); 
              
+                // create all the build queues configured in the database, not just the default!
              
+                List<BuildQueue> buildQueues = buildQueueService.getAllBuildQueues();
                 for( BuildQueue buildQueue : buildQueues )
                 {   
                     createOverallBuildQueue( buildQueue );
@@ -1129,7 +1142,7 @@
             {
                 log.error( "Cannot create overall build queue: " + e.getMessage() );
             }
-            catch ( ContinuumStoreException e )
+            catch ( BuildQueueServiceException e )
             {
                 log.error( "Cannot create overall build queue: " + e.getMessage() );
             }

Added: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildqueue/DefaultBuildQueueService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildqueue/DefaultBuildQueueService.java?rev=731853&view=auto
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildqueue/DefaultBuildQueueService.java
(added)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildqueue/DefaultBuildQueueService.java
Mon Jan  5 23:17:06 2009
@@ -0,0 +1,141 @@
+package org.apache.continuum.buildqueue;
+
+/*
+ * 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.List;
+
+import org.apache.continuum.dao.BuildQueueDao;
+import org.apache.continuum.dao.ScheduleDao;
+import org.apache.maven.continuum.model.project.BuildQueue;
+import org.apache.maven.continuum.model.project.Schedule;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+
+/**
+ * DefaultBuildQueueService
+ * 
+ * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
+ * @plexus.component role="org.apache.continuum.buildqueue.BuildQueueService"
+ */
+public class DefaultBuildQueueService
+    implements BuildQueueService
+{
+    /**
+     * @plexus.requirement
+     */
+    private BuildQueueDao buildQueueDao;
+    
+    /**
+     * @plexus.requirement
+     */
+    private ScheduleDao scheduleDao;
+
+    public BuildQueue addBuildQueue( BuildQueue buildQueue )
+        throws BuildQueueServiceException
+    {        
+        try
+        {
+            return buildQueueDao.addBuildQueue( buildQueue );
+        } 
+        catch ( ContinuumStoreException e )
+        {
+            throw new BuildQueueServiceException( e );
+        }
+    }
+
+    public List<BuildQueue> getAllBuildQueues()
+        throws BuildQueueServiceException
+    {
+        try
+        {
+            return buildQueueDao.getAllBuildQueues();
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new BuildQueueServiceException( e );
+        }
+    }
+
+    public BuildQueue getBuildQueue( int buildQueueId )
+        throws BuildQueueServiceException
+    {
+        try
+        {
+            return buildQueueDao.getBuildQueue( buildQueueId );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new BuildQueueServiceException( e );
+        }
+    }
+
+    public BuildQueue getBuildQueueByName( String buildQueueName )
+        throws BuildQueueServiceException
+    {
+        try
+        {
+            return buildQueueDao.getBuildQueueByName( buildQueueName );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new BuildQueueServiceException( e );
+        }
+    }
+
+    public void removeBuildQueue( BuildQueue buildQueue )
+        throws BuildQueueServiceException
+    {   
+        try
+        {
+            // detach from schedule(s) first
+            List<Schedule> schedules = scheduleDao.getAllSchedulesByName();
+            for( Schedule schedule : schedules )
+            {
+                List<BuildQueue> buildQueues = schedule.getBuildQueues();
+                if( buildQueues.contains( buildQueue ) )
+                {
+                    buildQueues.remove( buildQueue );
+                }
+                schedule.setBuildQueues( buildQueues );
+                
+                scheduleDao.updateSchedule( schedule );
+            }        
+        
+            buildQueueDao.removeBuildQueue( buildQueue );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new BuildQueueServiceException( e );
+        }
+    }
+
+    public BuildQueue updateBuildQueue( BuildQueue buildQueue )
+        throws BuildQueueServiceException
+    {
+        try
+        {
+            return buildQueueDao.storeBuildQueue( buildQueue );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw new BuildQueueServiceException( e );
+        }
+    }
+
+}

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=731853&r1=731852&r2=731853&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
Mon Jan  5 23:17:06 2009
@@ -35,9 +35,10 @@
 
 import org.apache.continuum.buildmanager.BuildManagerException;
 import org.apache.continuum.buildmanager.BuildsManager;
+import org.apache.continuum.buildqueue.BuildQueueService;
+import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.continuum.dao.BuildDefinitionDao;
-import org.apache.continuum.dao.BuildQueueDao;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ContinuumReleaseResultDao;
 import org.apache.continuum.dao.DaoUtils;
@@ -252,11 +253,11 @@
      * @plexus.requirement role-hint="parallel"
      */
     private BuildsManager parallelBuildsManager;
-    
+        
     /**
      * @plexus.requirement
      */
-    private BuildQueueDao buildQueueDao;
+    private BuildQueueService buildQueueService;
 
     public DefaultContinuum()
     {
@@ -3236,10 +3237,10 @@
     public BuildQueue addBuildQueue( BuildQueue buildQueue ) throws ContinuumException
     {
         try
-        {
-            return buildQueueDao.addBuildQueue( buildQueue );
+        {            
+            return buildQueueService.addBuildQueue( buildQueue );
         }
-        catch ( ContinuumStoreException e )
+        catch ( BuildQueueServiceException e )
         {
             throw new ContinuumException( "Error adding build queue to the database.", e
);
         }
@@ -3249,9 +3250,9 @@
     {
         try
         {
-            return buildQueueDao.getBuildQueue( buildQueueId );
+            return buildQueueService.getBuildQueue( buildQueueId );
         }
-        catch ( ContinuumStoreException e )
+        catch ( BuildQueueServiceException e )
         {
             throw new ContinuumException( "Error retrieving build queue.", e );
         }
@@ -3260,10 +3261,10 @@
     public BuildQueue getBuildQueueByName( String buildQueueName ) throws ContinuumException
     {
         try
-        {
-            return buildQueueDao.getBuildQueueByName( buildQueueName );
+        {            
+            return buildQueueService.getBuildQueueByName( buildQueueName );
         }
-        catch ( ContinuumStoreException e )
+        catch ( BuildQueueServiceException e )
         {
             throw new ContinuumException( "Error retrieving build queue.", e );
         }
@@ -3272,10 +3273,10 @@
     public void removeBuildQueue( BuildQueue buildQueue ) throws ContinuumException
     {
         try
-        {
-            buildQueueDao.removeBuildQueue( buildQueue );
+        {            
+            buildQueueService.removeBuildQueue( buildQueue );
         }
-        catch ( ContinuumStoreException e )
+        catch ( BuildQueueServiceException e )
         {
             throw new ContinuumException( "Error deleting build queue from database.", e
);
         }
@@ -3284,10 +3285,10 @@
     public BuildQueue storeBuildQueue( BuildQueue buildQueue ) throws ContinuumException
     {
         try
-        {
-            return buildQueueDao.storeBuildQueue( buildQueue );
+        {            
+            return buildQueueService.updateBuildQueue( buildQueue );
         }
-        catch ( ContinuumStoreException e )
+        catch ( BuildQueueServiceException e )
         {
             throw new ContinuumException( "Error updating build queue.", e );
         }
@@ -3296,10 +3297,10 @@
     public List<BuildQueue> getAllBuildQueues() throws ContinuumException
     {
         try
-        {
-            return buildQueueDao.getAllBuildQueues();
+        {            
+            return buildQueueService.getAllBuildQueues();
         }
-        catch ( ContinuumStoreException e )
+        catch ( BuildQueueServiceException e )
         {
             throw new ContinuumException( "Error adding build queue.", e );
         }

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java?rev=731853&r1=731852&r2=731853&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionService.java
Mon Jan  5 23:17:06 2009
@@ -18,6 +18,7 @@
  */
 package org.apache.maven.continuum.builddefinition;
 
+import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.configuration.ContinuumConfigurationException;
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.BuildDefinitionTemplateDao;
@@ -428,6 +429,10 @@
         {
             throw new BuildDefinitionServiceException( e.getMessage(), e );
         }
+        catch ( BuildQueueServiceException e )
+        {
+            throw new BuildDefinitionServiceException( e.getMessage(), e );
+        }
     }
 
     // ------------------------------------------------------

Modified: continuum/branches/continuum-parallel-builds/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java?rev=731853&r1=731852&r2=731853&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
Mon Jan  5 23:17:06 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.maven.continuum.model.project.BuildQueue;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.store.ContinuumStoreException;
@@ -190,7 +191,7 @@
     }
 
     public BuildQueue getDefaultBuildQueue()
-        throws ContinuumStoreException
+        throws BuildQueueServiceException
     {
         return null;
     }



Mime
View raw message