continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1154984 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ continuum-buildagent/continuum-builda...
Date Mon, 08 Aug 2011 15:08:47 GMT
Author: ctan
Date: Mon Aug  8 15:08:45 2011
New Revision: 1154984

URL: http://svn.apache.org/viewvc?rev=1154984&view=rev
Log:
[CONTINUUM-2683] increase logging
* add/remove from each queue INFO
* why is added (scheduled or triggered) DEBUG
* start/end build and agent location INFO
* agent selection info: what build agent is chosen for each project and why DEBUG
* currently preparing build/ building projects and where they are building
* currently queued projects and where they are queued

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
    continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
    continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
    continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
    continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
    continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
    continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java Mon Aug  8 15:08:45 2011
@@ -24,6 +24,7 @@ import java.util.Map;
 
 import org.apache.continuum.buildagent.NoBuildAgentException;
 import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
+import org.apache.continuum.configuration.BuildAgentConfiguration;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
@@ -41,6 +42,9 @@ public interface DistributedBuildManager
     void reload()
         throws ContinuumException;
 
+    void update( BuildAgentConfiguration buildAgent )
+        throws ContinuumException;
+
     void removeDistributedBuildQueueOfAgent( String buildAgentUrl )
         throws ContinuumException;
 

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentService.java Mon Aug  8 15:08:45 2011
@@ -135,4 +135,7 @@ public interface ContinuumBuildAgentServ
      */
     String getBuildAgentPlatform()
         throws ContinuumBuildAgentException;
+
+    void setBuildAgentUrl( String url )
+        throws ContinuumBuildAgentException;
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java Mon Aug  8 15:08:45 2011
@@ -50,4 +50,11 @@ public interface BuildAgentConfiguration
     List<LocalRepository> getLocalRepositories();
 
     String getSharedSecretPassword();
+
+    String getBuildAgentUrl();
+
+    void setBuildAgentUrl( String buildAgentUrl );
+
+    void store()
+        throws BuildAgentConfigurationException;
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-api/src/main/mdo/continuum-buildagent.xml Mon Aug  8 15:08:45 2011
@@ -68,6 +68,11 @@
           <version>1.4.1+</version>
           <type>String</type>
         </field>
+        <field>
+          <name>buildAgentUrl</name>
+          <version>1.4.1+</version>
+          <type>String</type>
+        </field>
       </fields>
     </class>
     <class xml.tagName="buildagent-installation">

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Mon Aug  8 15:08:45 2011
@@ -33,6 +33,7 @@ import org.apache.commons.lang.ArrayUtil
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
 import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
+import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationException;
 import org.apache.continuum.buildagent.configuration.BuildAgentConfigurationService;
 import org.apache.continuum.buildagent.manager.BuildAgentManager;
 import org.apache.continuum.buildagent.manager.BuildAgentReleaseManager;
@@ -111,7 +112,7 @@ public class ContinuumBuildAgentServiceI
 
         try
         {
-            log.debug( "Adding project group {} to prepare build queue", task.getProjectGroupId() );
+            log.info( "Adding project group {} to prepare build queue", task.getProjectGroupId() );
             buildAgentTaskQueueManager.getPrepareBuildQueue().put( task );
         }
         catch ( TaskQueueException e )
@@ -857,7 +858,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
-            log.debug( "Removing project group {} from prepare build queue", projectGroupId );
+            log.info( "Removing project group {} from prepare build queue", projectGroupId );
             return buildAgentTaskQueueManager.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
         }
         catch ( TaskQueueManagerException e )
@@ -872,7 +873,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
-            log.debug( "Removing project groups {} from prepare build queue", hashCodes );
+            log.info( "Removing project groups {} from prepare build queue", hashCodes );
             buildAgentTaskQueueManager.removeFromPrepareBuildQueue( listToIntArray( hashCodes ) );
         }
         catch ( TaskQueueManagerException e )
@@ -887,7 +888,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
-            log.debug( "Removing project {} with buildDefinition {} from build queue", projectId, buildDefinitionId );
+            log.info( "Removing project {} with buildDefinition {} from build queue", projectId, buildDefinitionId );
             return buildAgentTaskQueueManager.removeFromBuildQueue( projectId, buildDefinitionId );
         }
         catch ( TaskQueueManagerException e )
@@ -902,7 +903,7 @@ public class ContinuumBuildAgentServiceI
     {
         try
         {
-            log.debug( "Removing projects {} from build queue", hashCodes );
+            log.info( "Removing projects {} from build queue", hashCodes );
             buildAgentTaskQueueManager.removeFromBuildQueue( listToIntArray( hashCodes ) );
         }
         catch ( TaskQueueManagerException e )
@@ -941,6 +942,21 @@ public class ContinuumBuildAgentServiceI
         }
     }
 
+    public void setBuildAgentUrl( String url )
+        throws ContinuumBuildAgentException
+    {
+        try
+        {
+            buildAgentConfigurationService.setBuildAgentUrl( url );
+            buildAgentConfigurationService.store();
+        }
+        catch( BuildAgentConfigurationException e )
+        {
+            log.error( "Error occurred while setting build agent url " + url, e );
+            throw new ContinuumBuildAgentException( "Error occurred while setting build agent url " + url, e );
+        }
+    }
+
     private List<BuildContext> initializeBuildContext( List<Map<String, Object>> projectsBuildContext )
     {
         List<BuildContext> buildContext = new ArrayList<BuildContext>();

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java Mon Aug  8 15:08:45 2011
@@ -66,6 +66,7 @@ public class CreateBuildProjectTaskActio
             {
                 if ( !buildAgentTaskQueueManager.isProjectInBuildQueue( buildProjectTask.getProjectId() ) )
                 {
+                    log.info( "Adding project {} to build queue", buildProjectTask.getProjectId() );
                     buildAgentTaskQueueManager.getBuildQueue().put( buildProjectTask );
                 }
             }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java Mon Aug  8 15:08:45 2011
@@ -28,8 +28,7 @@ public interface BuildAgentConfiguration
     GeneralBuildAgentConfiguration getContinuumBuildAgentConfiguration()
         throws BuildAgentConfigurationException;
 
-    void setContinuumBuildAgentConfiguration( GeneralBuildAgentConfiguration configuration )
-        throws BuildAgentConfigurationException;
+    void setContinuumBuildAgentConfiguration( GeneralBuildAgentConfiguration configuration );
 
     void save()
         throws BuildAgentConfigurationException;

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java Mon Aug  8 15:08:45 2011
@@ -69,7 +69,6 @@ public class DefaultBuildAgentConfigurat
     }
 
     public GeneralBuildAgentConfiguration getContinuumBuildAgentConfiguration()
-        throws BuildAgentConfigurationException
     {
         return generalBuildAgentConfiguration;
     }
@@ -108,6 +107,7 @@ public class DefaultBuildAgentConfigurat
             this.generalBuildAgentConfiguration.setInstallations( configuration.getInstallations() );
             this.generalBuildAgentConfiguration.setLocalRepositories( configuration.getLocalRepositories() );
             this.generalBuildAgentConfiguration.setSharedSecretPassword( configuration.getSharedSecretPassword() );
+            this.generalBuildAgentConfiguration.setBuildAgentUrl( configuration.getBuildAgentUrl() );
         }
         catch ( IOException e )
         {
@@ -158,6 +158,7 @@ public class DefaultBuildAgentConfigurat
             configurationModel.setInstallations( this.generalBuildAgentConfiguration.getInstallations() );
             configurationModel.setLocalRepositories( this.generalBuildAgentConfiguration.getLocalRepositories() );
             configurationModel.setSharedSecretPassword( this.generalBuildAgentConfiguration.getSharedSecretPassword() );
+            configurationModel.setBuildAgentUrl( this.generalBuildAgentConfiguration.getBuildAgentUrl() );
 
             ContinuumBuildAgentConfigurationModelXpp3Writer writer =
                 new ContinuumBuildAgentConfigurationModelXpp3Writer();
@@ -174,7 +175,6 @@ public class DefaultBuildAgentConfigurat
     }
 
     public void setContinuumBuildAgentConfiguration( GeneralBuildAgentConfiguration buildAgentConfiguration )
-        throws BuildAgentConfigurationException
     {
         this.generalBuildAgentConfiguration = buildAgentConfiguration;
     }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java Mon Aug  8 15:08:45 2011
@@ -155,6 +155,24 @@ public class DefaultBuildAgentConfigurat
         return generalBuildAgentConfiguration.getSharedSecretPassword();
     }
 
+    public void setBuildAgentUrl( String buildAgentUrl )
+    {
+        generalBuildAgentConfiguration.setBuildAgentUrl( buildAgentUrl );
+    }
+
+    public String getBuildAgentUrl()
+    {
+        return generalBuildAgentConfiguration.getBuildAgentUrl();
+    }
+
+    public void store()
+        throws BuildAgentConfigurationException
+    {
+        buildAgentConfiguration.setContinuumBuildAgentConfiguration( generalBuildAgentConfiguration );
+
+        buildAgentConfiguration.save();
+    }
+
     private void loadData()
         throws BuildAgentConfigurationException
     {

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java Mon Aug  8 15:08:45 2011
@@ -39,6 +39,8 @@ public class GeneralBuildAgentConfigurat
 
     private String sharedSecretPassword;
 
+    private String buildAgentUrl;
+
     public File getWorkingDirectory()
     {
         return workingDirectory;
@@ -98,4 +100,14 @@ public class GeneralBuildAgentConfigurat
     {
         return sharedSecretPassword;
     }
+
+    public void setBuildAgentUrl( String buildAgentUrl )
+    {
+        this.buildAgentUrl = buildAgentUrl;
+    }
+
+    public String getBuildAgentUrl()
+    {
+        return buildAgentUrl;
+    }
 }

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java (original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java Mon Aug  8 15:08:45 2011
@@ -51,7 +51,7 @@ public class DefaultBuildAgentManager
             MasterBuildAgentTransportClient client =
                 new MasterBuildAgentTransportClient( new URL( buildAgentConfigurationService.getContinuumServerUrl() ) )
                 ;
-            client.startProjectBuild( projectId );
+            client.startProjectBuild( projectId, getBuildAgentUrl() );
         }
         catch ( MalformedURLException e )
         {
@@ -75,7 +75,7 @@ public class DefaultBuildAgentManager
             MasterBuildAgentTransportClient client =
                 new MasterBuildAgentTransportClient( new URL( buildAgentConfigurationService.getContinuumServerUrl() ) )
                 ;
-            client.returnBuildResult( buildResult );
+            client.returnBuildResult( buildResult, getBuildAgentUrl() );
         }
         catch ( MalformedURLException e )
         {
@@ -99,7 +99,7 @@ public class DefaultBuildAgentManager
             MasterBuildAgentTransportClient client =
                 new MasterBuildAgentTransportClient( new URL( buildAgentConfigurationService.getContinuumServerUrl() ) )
                 ;
-            return client.getEnvironments( buildDefinitionId, installationType );
+            return client.getEnvironments( buildDefinitionId, installationType, getBuildAgentUrl() );
         }
         catch ( MalformedURLException e )
         {
@@ -147,7 +147,7 @@ public class DefaultBuildAgentManager
             MasterBuildAgentTransportClient client =
                 new MasterBuildAgentTransportClient( new URL( buildAgentConfigurationService.getContinuumServerUrl() ) )
                 ;
-            return client.shouldBuild( context );
+            return client.shouldBuild( context, getBuildAgentUrl() );
         }
         catch ( MalformedURLException e )
         {
@@ -171,7 +171,7 @@ public class DefaultBuildAgentManager
             MasterBuildAgentTransportClient client =
                 new MasterBuildAgentTransportClient( new URL( buildAgentConfigurationService.getContinuumServerUrl() ) )
                 ;
-            client.startPrepareBuild( context );
+            client.startPrepareBuild( context, getBuildAgentUrl() );
         }
         catch ( MalformedURLException e )
         {
@@ -195,7 +195,7 @@ public class DefaultBuildAgentManager
             MasterBuildAgentTransportClient client =
                 new MasterBuildAgentTransportClient( new URL( buildAgentConfigurationService.getContinuumServerUrl() ) )
                 ;
-            client.prepareBuildFinished( context );
+            client.prepareBuildFinished( context, getBuildAgentUrl() );
         }
         catch ( MalformedURLException e )
         {
@@ -238,4 +238,9 @@ public class DefaultBuildAgentManager
             throw new ContinuumException( "Unable to ping master " + continuumServerUrl + " from build agent", e );
         }
     }
+
+    private String getBuildAgentUrl()
+    {
+        return buildAgentConfigurationService.getBuildAgentUrl();
+    }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Mon Aug  8 15:08:45 2011
@@ -53,6 +53,7 @@ import org.apache.maven.continuum.model.
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.model.system.Profile;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
@@ -188,32 +189,59 @@ public class DefaultDistributedBuildMana
             {
                 if ( agent.isEnabled() && !overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
                 {
+                    SlaveBuildAgentTransportService client = null;
+
                     try
                     {
-                        SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( agent.getUrl() );
-    
-                        if ( client.ping() )
-                        {
-                            log.debug( "agent is enabled, create distributed build queue for build agent '{}'", agent.getUrl() );
-                            createDistributedBuildQueueForAgent( agent.getUrl() );
-                        }
-                        else
-                        {
-                            log.debug( "unable to ping build agent '{}'", agent.getUrl() );
-                        }
+                        client = createSlaveBuildAgentTransportClientConnection( agent.getUrl() );
                     }
                     catch ( MalformedURLException e )
                     {
-                        // do not throw exception, just log it
                         log.error( "Invalid build agent URL {}, not creating distributed build queue", agent.getUrl() );
+                        throw new ContinuumException( "Malformed build agent url " + agent.getUrl() );
                     }
                     catch ( Exception e )
                     {
                         agent.setEnabled( false );
-                        log.error( "unable to ping build agent '{}': {}", agent.getUrl(),
-                            ContinuumUtils.throwableToString( e ) );
+                        configurationService.updateBuildAgent( agent );
+
+                        log.error( "Error binding build agent {} service : {} ", agent.getUrl(), ContinuumUtils.throwableToString( e ) );
                         throw new ContinuumException( e.getMessage() );
                     }
+
+                    boolean ping = false;
+
+                    try
+                    {
+                        ping = client.ping();
+                    }
+                    catch ( Exception e )
+                    {
+                        agent.setEnabled( false );
+                        log.error( "Unable to ping build agent '{}': {}", agent.getUrl(),
+                                   ContinuumUtils.throwableToString( e ) );
+                    }
+
+                    if ( ping )
+                    {
+                        try
+                        {
+                            createDistributedBuildQueueForAgent( agent.getUrl() );
+                            log.debug( "Agent is enabled, create distributed build queue for build agent '{}'", agent.getUrl() );
+                        }
+                        catch ( Exception e )
+                        {
+                            agent.setEnabled( false );
+                            log.error( "Unable to create distributed queue for build agent {} : {}", agent.getUrl(), ContinuumUtils.throwableToString( e ) );
+                        }
+                    }
+                    else
+                    {
+                        agent.setEnabled( false );
+                        log.error( "Unable to ping build agent '{}'", agent.getUrl() );
+                    }
+
+                    configurationService.updateBuildAgent( agent );
                 }
                 else if ( !agent.isEnabled() && overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
                 {
@@ -224,6 +252,74 @@ public class DefaultDistributedBuildMana
         }
     }
 
+    public void update( BuildAgentConfiguration agent )
+        throws ContinuumException
+    {
+        synchronized( overallDistributedBuildQueues )
+        {
+            if ( agent.isEnabled() && !overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
+            {
+                SlaveBuildAgentTransportService client = null;
+
+                try
+                {
+                    client = createSlaveBuildAgentTransportClientConnection( agent.getUrl() );
+                }
+                catch ( MalformedURLException e )
+                {
+                    configurationService.removeBuildAgent( agent );
+                    log.error( "Invalid build agent URL {}, not creating distributed build queue", agent.getUrl() );
+                    throw new ContinuumException( "Malformed build agent url " + agent.getUrl() );
+                }
+                catch ( Exception e )
+                {
+                    configurationService.removeBuildAgent( agent );
+                    log.error( "Error binding build agent {} service : {} ", agent.getUrl(), ContinuumUtils.throwableToString( e ) );
+                    throw new ContinuumException( e.getMessage() );
+                }
+
+                boolean ping = false;
+
+                try
+                {
+                    ping = client.ping();
+                }
+                catch ( Exception e )
+                {
+                    configurationService.removeBuildAgent( agent );
+                    log.error( "Unable to ping build agent '{}': {}", agent.getUrl(),
+                               ContinuumUtils.throwableToString( e ) );
+                    throw new ContinuumException( "Unable to ping build agent " + agent.getUrl() );
+                }
+
+                if ( ping )
+                {
+                    try
+                    {
+                        createDistributedBuildQueueForAgent( agent.getUrl() );
+                        log.debug( "Agent is enabled, create distributed build queue for build agent '{}'", agent.getUrl() );
+                    }
+                    catch ( Exception e )
+                    {
+                        configurationService.removeBuildAgent( agent );
+                        log.error( "Unable to create distributed queue for build agent {} : {}", agent.getUrl(), ContinuumUtils.throwableToString( e ) );
+                    }
+                }
+                else
+                {
+                    configurationService.removeBuildAgent( agent );
+                    log.error( "Unable to ping build agent '{}'", agent.getUrl() );
+                    throw new ContinuumException( "Unable to ping build agent " + agent.getUrl() );
+                }
+            }
+            else if ( !agent.isEnabled() && overallDistributedBuildQueues.containsKey( agent.getUrl() ) )
+            {
+                log.debug( "agent is disabled, remove distributed build queue for build agent '{}'", agent.getUrl() );
+                removeDistributedBuildQueueOfAgent( agent.getUrl() );
+            }
+        }
+    }
+
     @SuppressWarnings( "unused" )
     public void prepareBuildProjects( Map<Integer, Integer>projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, 
                                       String projectGroupName, String scmRootAddress, int scmRootId, List<ProjectScmRoot> scmRoots )
@@ -233,6 +329,63 @@ public class DefaultDistributedBuildMana
                                                                       projectGroupId, projectGroupName, 
                                                                       scmRootAddress, scmRootId );
 
+    	if ( buildTrigger.getTrigger() == ContinuumProjectState.TRIGGER_FORCED )
+    	{
+    	    log.debug( "Build project triggered manually by {}", buildTrigger.getTriggeredBy() );
+    	}
+    	else
+    	{
+    	    log.debug( "Build project triggered by schedule {}", buildTrigger.getTriggeredBy() );
+    	}
+
+    	if ( log.isDebugEnabled() )
+    	{
+    	    log.debug( "Projects currently building:" );
+
+    	    Map<String, BuildProjectTask> buildTasks = getProjectsCurrentlyBuilding();
+
+    	    for ( String key : buildTasks.keySet() )
+    	    {
+    	        log.debug( "Build agent {} : Project {}", key, buildTasks.get( key ).getProjectName() );
+    	    }
+
+    	    log.debug( "Projects in build queue:" );
+
+    	    Map<String, List<BuildProjectTask>> buildQueues = getProjectsInBuildQueue();
+
+    	    for ( String key : buildQueues.keySet() )
+    	    {
+    	        for ( BuildProjectTask buildTask : buildQueues.get( key ) )
+    	        {
+    	            log.debug( "Build agent {} : Project {}", key, buildTask.getProjectName() );
+    	        }
+    	    }
+
+    	    log.debug( "Projects currently preparing build:" );
+
+    	    Map<String, PrepareBuildProjectsTask> prepareBuildTasks = getProjectsCurrentlyPreparingBuild();
+
+    	    for( String key : prepareBuildTasks.keySet() )
+    	    {
+    	        PrepareBuildProjectsTask prepareBuildTask = prepareBuildTasks.get( key );
+    	        log.debug( "Build agent {} : Project Group {} - Scm Root {}", 
+    	                   new Object[] { key, prepareBuildTask.getProjectGroupName(), prepareBuildTask.getProjectScmRootId() } );
+    	    }
+
+    	    log.debug( "Projects in prepare build queue:" );
+
+    	    Map<String, List<PrepareBuildProjectsTask>> prepareBuildQueues = getProjectsInPrepareBuildQueue();
+
+    	    for ( String key : prepareBuildQueues.keySet() )
+    	    {
+    	        for ( PrepareBuildProjectsTask prepareBuildTask : prepareBuildQueues.get( key ) )
+    	        {
+    	            log.debug( "Build agent {} : Project Group {} - Scm Root {}", 
+    	                       new Object[] { key, prepareBuildTask.getProjectGroupName(), prepareBuildTask.getProjectScmRootId() } );
+    	        }
+    	    }
+    	}
+
     	log.debug( "Determining which build agent should build the project..." );
 
     	OverallDistributedBuildQueue overallDistributedBuildQueue = getOverallDistributedBuildQueueByGroup( projectGroupId, scmRoots, scmRootId );
@@ -254,14 +407,14 @@ public class DefaultDistributedBuildMana
                 else
                 {
                     // get overall distributed build queue from build agent group
-                    log.info( "Getting the least busy build agent from the build agent group" );
+                    log.info( "Getting the least busy build agent within the build agent group" );
                     overallDistributedBuildQueue = getOverallDistributedBuildQueueByAgentGroup( projectsBuildDefinitionsMap );
                 }
             }
             else
             {
                 // project does not have build agent group
-                log.info( "Project does not have a build agent group, getting the least busy build agent" );
+                log.info( "Project does not have a build agent group, getting the least busy of all build agents" );
                 overallDistributedBuildQueue = getOverallDistributedBuildQueue();
             }
         }
@@ -270,6 +423,7 @@ public class DefaultDistributedBuildMana
         {
             try
             {
+                log.info( "Building project in the least busy agent {}", overallDistributedBuildQueue.getBuildAgentUrl() );
                 overallDistributedBuildQueue.addToDistributedBuildQueue( task );
             }
             catch ( TaskQueueException e )
@@ -354,7 +508,7 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
-                        log.debug( "Getting projects in prepare build queue of build agent{}", buildAgentUrl );
+                        log.debug( "Getting projects in prepare build queue of build agent {}", buildAgentUrl );
 
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
 
@@ -821,7 +975,7 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
-                log.debug( "Removing projectGroupId {} from prepare build queue of build agent {}", projectGroupId, buildAgentUrl );
+                log.info( "Removing projectGroupId {} from prepare build queue of build agent {}", projectGroupId, buildAgentUrl );
 
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.removeFromPrepareBuildQueue( projectGroupId, scmRootId );
@@ -858,7 +1012,7 @@ public class DefaultDistributedBuildMana
         {
             if ( isAgentAvailable( buildAgentUrl ) )
             {
-                log.debug( "Removing projectId {} from build queue of build agent {}", projectId, buildAgentUrl );
+                log.info( "Removing projectId {} from build queue of build agent {}", projectId, buildAgentUrl );
                 SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                 client.removeFromBuildQueue( projectId, buildDefinitionId );
             }
@@ -897,7 +1051,7 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
-                        log.debug( "Removing project groups from prepare build queue of build agent {}", buildAgentUrl );
+                        log.info( "Removing project groups from prepare build queue of build agent {}", buildAgentUrl );
 
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         client.removeFromPrepareBuildQueue( hashCodes );
@@ -933,7 +1087,7 @@ public class DefaultDistributedBuildMana
                 {
                     if ( isAgentAvailable( buildAgentUrl ) )
                     {
-                        log.debug( "Removing projects from build queue of build agent {}", buildAgentUrl );
+                        log.info( "Removing projects from build queue of build agent {}", buildAgentUrl );
 
                         SlaveBuildAgentTransportService client = createSlaveBuildAgentTransportClientConnection( buildAgentUrl );
                         client.removeFromBuildQueue( hashCodes );
@@ -1300,6 +1454,10 @@ public class DefaultDistributedBuildMana
                             return distributedBuildQueue;
                         }
                     }
+                    else
+                    {
+                        log.debug( "Build agent {} is not available. Skipping...", buildAgentUrl );
+                    }
                 }
                 catch ( TaskQueueException e )
                 {
@@ -1391,6 +1549,7 @@ public class DefaultDistributedBuildMana
                                         log.debug( "Number of projects currently building in agent: {}", agentBuildSize );
                                         if ( idx == 0 )
                                         {
+                                            log.debug( "Current least busy agent: {}", buildAgentUrl );
                                             whereToBeQueued = distributedBuildQueue;
                                             size = agentBuildSize;
                                             idx++;
@@ -1398,10 +1557,15 @@ public class DefaultDistributedBuildMana
     
                                         if ( agentBuildSize < size )
                                         {
+                                            log.debug( "Current least busy agent: {}", buildAgentUrl );
                                             whereToBeQueued = distributedBuildQueue;
                                             size = agentBuildSize;
                                         }
                                     }
+                                    else
+                                    {
+                                        log.debug( "Build agent {} is not available. Skipping...", buildAgentUrl );
+                                    }
                                 }
                                 catch ( MalformedURLException e )
                                 {
@@ -1455,6 +1619,7 @@ public class DefaultDistributedBuildMana
                             log.debug( "Number of projects currently building in agent: {}", agentBuildSize );
                             if ( idx == 0 )
                             {
+                                log.debug( "Current least busy agent: {}", buildAgentUrl );
                                 whereToBeQueued = distributedBuildQueue;
                                 size = agentBuildSize;
                                 idx++;
@@ -1462,10 +1627,15 @@ public class DefaultDistributedBuildMana
     
                             if ( agentBuildSize < size )
                             {
+                                log.debug( "Current least busy agent: {}", buildAgentUrl );
                                 whereToBeQueued = distributedBuildQueue;
                                 size = agentBuildSize;
                             }
                         }
+                        else
+                        {
+                            log.debug( "Build agent {} is not available. Skipping...", buildAgentUrl );
+                        }
                     }
                     catch ( MalformedURLException e )
                     {

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Mon Aug  8 15:08:45 2011
@@ -967,7 +967,7 @@ public class DefaultContinuum
             }
         }
 
-        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" );
+        BuildTrigger buildTrigger = new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, schedule.getName() );
 
         for ( ProjectScmRoot scmRoot : sortedScmRoot )
         {

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManagerTest.java Mon Aug  8 15:08:45 2011
@@ -550,6 +550,8 @@ public class DefaultDistributedBuildMana
                 one( configurationService ).getBuildAgents();
                 will( returnValue( buildAgents ) );
 
+                one( overallDistributedBuildQueue1 ).getBuildAgentUrl();
+
                 one( overallDistributedBuildQueue1 ).addToDistributedBuildQueue( with( any( Task.class ) ) );
             }
         } );

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/builder/distributed/stubs/SlaveBuildAgentTransportClientStub.java Mon Aug  8 15:08:45 2011
@@ -280,4 +280,11 @@ public class SlaveBuildAgentTransportCli
         return null;
     }
 
+    public void setBuildAgentUrl( String buildAgentUrl )
+        throws Exception
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutorTest.java Mon Aug  8 15:08:45 2011
@@ -29,6 +29,7 @@ import org.apache.continuum.buildmanager
 import org.apache.continuum.buildmanager.ParallelBuildsManager;
 import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.model.project.ProjectScmRoot;
+import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.configuration.ConfigurationService;
@@ -93,11 +94,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -120,7 +117,8 @@ public class PrepareBuildProjectsTaskExe
 
         assertTrue( "failed to checkout project 'module-D'", new File( workingDir, Integer.toString( moduleD.getId() ) ).list().length > 0 );
 
-        buildsManager.cancelAllBuilds();
+        // wait while task finished build
+        waitForBuildToFinish();
     }
 
     public void testCheckoutPrepareBuildMultiModuleProjectFreshBuild()
@@ -142,11 +140,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -169,7 +163,8 @@ public class PrepareBuildProjectsTaskExe
 
         assertTrue( "failed to checkout project 'module-D'", new File( workingDir, Integer.toString( moduleD.getId() ) ).list().length > 0 );
  
-        buildsManager.cancelAllBuilds();
+        // wait while task finished build
+        waitForBuildToFinish();
     }
 
     public void testCheckoutPrepareBuildSingleCheckedoutMultiModuleProject()
@@ -187,11 +182,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -214,7 +205,8 @@ public class PrepareBuildProjectsTaskExe
 
         assertTrue( "failed to checkout project 'module-D'", new File( checkedOutDir, "module-C/module-D" ).list().length > 0 );
 
-        buildsManager.cancelAllBuilds();
+        // wait while task finishes build
+        waitForBuildToFinish();
     }
 
     public void testCheckoutPrepareBuildSingleCheckedoutMultiModuleProjectFreshBuild()
@@ -232,11 +224,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -259,7 +247,8 @@ public class PrepareBuildProjectsTaskExe
 
         assertTrue( "failed to checkout project 'module-D'", new File( checkedOutDir, "module-C/module-D" ).list().length > 0 );
 
-        buildsManager.cancelAllBuilds();
+        // wait while task finishes build
+        waitForBuildToFinish();
     }
 
     public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProject()
@@ -277,11 +266,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -304,7 +289,8 @@ public class PrepareBuildProjectsTaskExe
         
         assertTrue( "failed to checkout module-d", new File( checkedOutDir, "module-c/module-d" ).list().length > 0 );
 
-        buildsManager.cancelAllBuilds();
+        // wait while task finishes build
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
     }
 
     public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProjectBuildFresh()
@@ -322,11 +308,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -349,7 +331,8 @@ public class PrepareBuildProjectsTaskExe
        
         assertTrue( "failed to checkout module-d", new File( checkedOutDir, "module-c/module-d" ).list().length > 0 );
 
-        buildsManager.cancelAllBuilds();
+        // wait while task finishes build
+        waitForBuildToFinish();
     }
 
     public void testCheckoutPrepareBuildSingleCheckoutFlatMultiModuleProjectBuildFreshAfterRemovingWorkingCopy()
@@ -374,11 +357,7 @@ public class PrepareBuildProjectsTaskExe
                                             task.getProjectGroupName(), task.getScmRootAddress(), task.getProjectScmRootId() );
 
         // wait while task finishes prepare build
-        while( buildsManager.isInPrepareBuildQueue( task.getProjectGroupId(), task.getProjectScmRootId() ) || 
-               buildsManager.isProjectGroupCurrentlyPreparingBuild( task.getProjectGroupId(), task.getProjectScmRootId() ) )
-        {
-            Thread.sleep( 10 );
-        }
+        waitForPrepareBuildToFinish( task.getProjectGroupId(), task.getProjectScmRootId() );
 
         ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRoot( task.getProjectScmRootId() );
         assertEquals( "Failed to update multi-module project", ContinuumProjectState.UPDATED, scmRoot.getState() );
@@ -401,7 +380,8 @@ public class PrepareBuildProjectsTaskExe
         
         assertTrue( "failed to checkout module-d", new File( checkedOutDir, "module-c/module-d" ).list().length > 0 );
 
-        buildsManager.cancelAllBuilds();
+        // wait while task finishes build
+        waitForBuildToFinish();
     }
 
     private PrepareBuildProjectsTask createTask( String pomResource, boolean singleCheckout, boolean buildFresh )
@@ -549,4 +529,39 @@ public class PrepareBuildProjectsTaskExe
             return path1.substring( 0, indexDiff );
         }
     }
+
+    private void waitForPrepareBuildToFinish( int projectGroupId, int scmRootId )
+        throws Exception
+    {
+        while( buildsManager.isInPrepareBuildQueue( projectGroupId, scmRootId ) || 
+               buildsManager.isProjectGroupCurrentlyPreparingBuild( projectGroupId, scmRootId ) )
+        {
+            Thread.sleep( 10 );
+        }
+    }
+
+    private void waitForBuildToFinish()
+        throws Exception
+    {
+        while( buildsManager.isBuildInProgress() || isAnyProjectInBuildQueue() )
+        {
+            Thread.sleep( 10 );
+        }
+    }
+
+    private boolean isAnyProjectInBuildQueue()
+        throws Exception
+    {
+        Map<String, List<BuildProjectTask>> buildTasks = buildsManager.getProjectsInBuildQueues();
+
+        for ( String queue : buildTasks.keySet() )
+        {
+            if ( !buildTasks.get( queue ).isEmpty() )
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-api/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportService.java Mon Aug  8 15:08:45 2011
@@ -29,19 +29,19 @@ import java.util.Map;
 @ServiceObject("MasterBuildAgentTransportService")
 public interface MasterBuildAgentTransportService
 {
-    public Boolean returnBuildResult( Map<String, Object> buildResult )
+    public Boolean returnBuildResult( Map<String, Object> buildResult, String buildAgentUrl )
         throws Exception;
 
-    public Boolean startProjectBuild( Integer projectId )
+    public Boolean startProjectBuild( Integer projectId, String buildAgentUrl )
         throws Exception;
 
-    public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult )
+    public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult, String buildAgentUrl )
         throws Exception;
 
-    public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult )
+    public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult, String buildAgentUrl )
         throws Exception;
 
-    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType )
+    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType, String buildAgentUrl )
         throws Exception;
 
     public Boolean updateProject( Map<String, Object> project )
@@ -50,6 +50,6 @@ public interface MasterBuildAgentTranspo
     public Boolean ping()
         throws Exception;
 
-    public Boolean shouldBuild( Map<String, Object> context )
+    public Boolean shouldBuild( Map<String, Object> context, String buildAgentUrl )
         throws Exception;
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-client/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportClient.java Mon Aug  8 15:08:45 2011
@@ -78,7 +78,7 @@ public class MasterBuildAgentTransportCl
         }
     }
 
-    public Boolean returnBuildResult( Map<String, Object> buildResult )
+    public Boolean returnBuildResult( Map<String, Object> buildResult, String buildAgentUrl )
         throws Exception
     {
         Boolean result;
@@ -86,13 +86,13 @@ public class MasterBuildAgentTransportCl
 
         try
         {
-            result = master.returnBuildResult( buildResult );
-            log.debug( "Returning the build result for project {} to master {}", projectInfo, masterServerUrl );
+            result = master.returnBuildResult( buildResult, buildAgentUrl );
+            log.info( "Build finished. Returning the build result for project {} to master {}", projectInfo, masterServerUrl );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to return the build result for project " + projectInfo + " to master " + masterServerUrl, e );
-            throw new Exception( "Failed to return the build result for project " + projectInfo + " to master " + masterServerUrl, e );
+            log.error( "Failed to finish the build and return the build result for project " + projectInfo + " to master " + masterServerUrl, e );
+            throw new Exception( "Failed to finish the build and return the build result for project " + projectInfo + " to master " + masterServerUrl, e );
         }
 
         return result;
@@ -117,7 +117,7 @@ public class MasterBuildAgentTransportCl
         return result;
     }
 
-    public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult )
+    public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult, String buildAgentUrl )
         throws Exception
     {
         Boolean result;
@@ -125,8 +125,8 @@ public class MasterBuildAgentTransportCl
 
         try
         {
-            result = master.prepareBuildFinished( prepareBuildResult );
-            log.debug( "Prepare build finished for project '{}'", projectInfo );
+            result = master.prepareBuildFinished( prepareBuildResult, buildAgentUrl );
+            log.info( "Prepare build finished for project '{}'", projectInfo );
         }
         catch ( Exception e )
         {
@@ -137,26 +137,26 @@ public class MasterBuildAgentTransportCl
         return result;
     }
 
-    public Boolean startProjectBuild( Integer projectId )
+    public Boolean startProjectBuild( Integer projectId, String buildAgentUrl )
         throws Exception
     {
         Boolean result;
 
         try
         {
-            result = master.startProjectBuild( projectId );
-            log.debug( "Return project currently building, projectId={} to master {}", projectId, masterServerUrl );
+            result = master.startProjectBuild( projectId, buildAgentUrl );
+            log.info( "Start project {} build", projectId );
         }
         catch ( Exception e )
         {
-            log.error( "Failed to return project currently building, projectId=" + projectId + " to master " + masterServerUrl, e );
-            throw new Exception( "Failed to return project currently building, projectId=" + projectId + " to master " + masterServerUrl, e );
+            log.error( "Failed to start build of projectId=" + projectId + " to master " + masterServerUrl, e );
+            throw new Exception( "Failed to start build of projectId=" + projectId + " to master " + masterServerUrl, e );
         }
 
         return result;
     }
 
-    public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult )
+    public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult, String buildAgentUrl )
         throws Exception
     {
         Boolean result;
@@ -164,8 +164,8 @@ public class MasterBuildAgentTransportCl
 
         try
         {
-            result = master.startPrepareBuild( prepareBuildResult );
-            log.debug( "Start prepare build for project {}", projectInfo );
+            result = master.startPrepareBuild( prepareBuildResult, buildAgentUrl );
+            log.info( "Start prepare build for project {}", projectInfo );
         }
         catch ( Exception e )
         {
@@ -176,13 +176,13 @@ public class MasterBuildAgentTransportCl
         return result;
     }
 
-    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType )
+    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType, String buildAgentUrl )
         throws Exception
     {
         Map<String, String> result;
         try
         {
-            result = master.getEnvironments( buildDefinitionId, installationType );
+            result = master.getEnvironments( buildDefinitionId, installationType, buildAgentUrl );
             log.debug( "Retrieved environments. buildDefinitionId={}, installationType={} from master {}",
                        new Object[] { buildDefinitionId, installationType, masterServerUrl } );
         }
@@ -217,7 +217,7 @@ public class MasterBuildAgentTransportCl
         return result;
     }
 
-    public Boolean shouldBuild( Map<String, Object> context )
+    public Boolean shouldBuild( Map<String, Object> context, String buildAgentUrl )
         throws Exception
     {
         Boolean result;
@@ -225,7 +225,7 @@ public class MasterBuildAgentTransportCl
 
         try
         {
-            result = master.shouldBuild( context );
+            result = master.shouldBuild( context, buildAgentUrl );
             log.debug( "Checking if project {} should build from master {}", projectInfo, masterServerUrl );
         }
         catch ( Exception e )

Modified: continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-master/continuum-distributed-master-server/src/main/java/org/apache/continuum/distributed/transport/master/MasterBuildAgentTransportServer.java Mon Aug  8 15:08:45 2011
@@ -41,65 +41,71 @@ public class MasterBuildAgentTransportSe
         this.distributedBuildService = distributedBuildService;
     }
 
-    public Boolean returnBuildResult( Map<String, Object> buildResult )
+    public Boolean returnBuildResult( Map<String, Object> buildResult, String buildAgentUrl )
         throws Exception
     {
-        log.info( "Build result returned for project " + ContinuumDistributedUtil.getProjectNameAndId( buildResult ) + "." );
         distributedBuildService.updateBuildResult( buildResult );
+        log.info( "Project build finished in build agent {}. Returned build result for project {}", 
+                  buildAgentUrl, ContinuumDistributedUtil.getProjectNameAndId( buildResult ) );
         return Boolean.TRUE;
     }
 
     public Boolean ping()
         throws Exception
     {
-        log.info( "Ping ok" );
+        log.debug( "Ping master ok" );
 
         return Boolean.TRUE;
     }
 
-    public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult )
+    public Boolean prepareBuildFinished( Map<String, Object> prepareBuildResult, String buildAgentUrl )
         throws Exception
     {
-        log.info( "Prepare build finished for project " + ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult ) + "." );
         distributedBuildService.prepareBuildFinished( prepareBuildResult );
+        log.info( "Prepare build finished for project {} in build agent {}", 
+                   ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult ), buildAgentUrl );
         return Boolean.TRUE;
     }
 
-    public Boolean startProjectBuild( Integer projectId )
+    public Boolean startProjectBuild( Integer projectId, String buildAgentUrl )
         throws Exception
     {
-        log.info( "Start project '" + projectId + "' build." );
         distributedBuildService.startProjectBuild( projectId );
+        log.info( "Start building project '{}' in build agent {}.", projectId, buildAgentUrl );
         return Boolean.TRUE;
     }
 
-    public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult )
+    public Boolean startPrepareBuild( Map<String, Object> prepareBuildResult, String buildAgentUrl )
         throws Exception
     {
-        log.info( "Start prepare build of project " + ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult ) + "." );
         distributedBuildService.startPrepareBuild( prepareBuildResult );
+        log.info( "Start preparing build of project {} in build agent {}",
+                   ContinuumDistributedUtil.getProjectNameAndId( prepareBuildResult ), buildAgentUrl );
         return Boolean.TRUE;
     }
 
-    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType )
+    public Map<String, String> getEnvironments( Integer buildDefinitionId, String installationType, String buildAgentUrl )
         throws Exception
     {
-        log.info( "Retrieving environments. buildDefinitionId=" + buildDefinitionId + ", installationType=" + installationType );
-        return distributedBuildService.getEnvironments( buildDefinitionId, installationType );
+        Map<String, String> envs = distributedBuildService.getEnvironments( buildDefinitionId, installationType );
+        log.debug( "Retrieving environments by build agent {}. buildDefinitionId={}, installationType={}", 
+                   new Object[] { buildAgentUrl, buildDefinitionId, installationType } );
+        return envs;
     }
 
     public Boolean updateProject( Map<String, Object> project )
         throws Exception
     {
-        log.info( "Start updating project " + ContinuumDistributedUtil.getProjectNameAndId( project ) );
         distributedBuildService.updateProject( project );
+        log.debug( "Start updating project {}", ContinuumDistributedUtil.getProjectNameAndId( project ) );
         return Boolean.TRUE;
     }
 
-    public Boolean shouldBuild( Map<String, Object> context )
+    public Boolean shouldBuild( Map<String, Object> context, String buildAgentUrl )
         throws Exception
     {
-        log.info( "Checking if project " + ContinuumDistributedUtil.getProjectNameAndId( context ) + " should build" );
+        log.debug( "Checking if project {} should build in build agent {}",
+                   ContinuumDistributedUtil.getProjectNameAndId( context ), buildAgentUrl );
         return distributedBuildService.shouldBuild( context );
     }
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-api/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportService.java Mon Aug  8 15:08:45 2011
@@ -148,4 +148,7 @@ public interface SlaveBuildAgentTranspor
      */
     public String getBuildAgentPlatform()
         throws Exception;
+
+    public void setBuildAgentUrl( String buildAgentUrl )
+        throws Exception;
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-client/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportClient.java Mon Aug  8 15:08:45 2011
@@ -163,6 +163,11 @@ public class SlaveBuildAgentTransportCli
         {
             result = slave.ping();
             log.debug( "Ping build agent {} : {}", buildAgentUrl, ( result ? "ok" : "failed" ) );
+
+            if ( result )
+            {
+                slave.setBuildAgentUrl( buildAgentUrl );
+            }
         }
         catch ( Exception e )
         {
@@ -772,4 +777,10 @@ public class SlaveBuildAgentTransportCli
 
         return result;
     }
+
+    public void setBuildAgentUrl( String buildAgentUrl )
+        throws Exception
+    {
+        slave.setBuildAgentUrl( buildAgentUrl );
+    }
 }

Modified: continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java (original)
+++ continuum/trunk/continuum-distributed/continuum-distributed-slave/continuum-distributed-slave-server/src/main/java/org/apache/continuum/distributed/transport/slave/SlaveBuildAgentTransportServer.java Mon Aug  8 15:08:45 2011
@@ -561,4 +561,10 @@ public class SlaveBuildAgentTransportSer
     {
         return continuumBuildAgentService.getBuildAgentPlatform();
     }
+
+    public void setBuildAgentUrl( String buildAgentUrl )
+        throws Exception
+    {
+        continuumBuildAgentService.setBuildAgentUrl( buildAgentUrl );
+    }
 }

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java (original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java Mon Aug  8 15:08:45 2011
@@ -81,8 +81,8 @@ public class DaoUtilsImpl
 
     public void eraseDatabase()
     {
-        PlexusJdoUtils.removeAll( getPersistenceManager(), BuildDefinitionTemplate.class );
         PlexusJdoUtils.removeAll( getPersistenceManager(), BuildResult.class );
+        PlexusJdoUtils.removeAll( getPersistenceManager(), BuildDefinitionTemplate.class );
         PlexusJdoUtils.removeAll( getPersistenceManager(), ContinuumReleaseResult.class );
         PlexusJdoUtils.removeAll( getPersistenceManager(), ProjectScmRoot.class );
         PlexusJdoUtils.removeAll( getPersistenceManager(), ProjectGroup.class );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java Mon Aug  8 15:08:45 2011
@@ -207,7 +207,7 @@ public class BuildAgentAction
 
         try
         {
-            getContinuum().getDistributedBuildManager().reload();
+            getContinuum().getDistributedBuildManager().update( buildAgent );
         }
         catch( ContinuumException e )
         {

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/buildQueueView.jsp Mon Aug  8 15:08:45 2011
@@ -30,7 +30,7 @@
       <meta http-equiv="refresh" content="60"/>
     </head>
     <body>
-      <s:form id="buildQueueForm" action="none" method="post">
+      
         <div id="h3">
           <h3>
             <s:text name="buildQueue.currentTask.section.title"/>
@@ -72,7 +72,7 @@
             <s:text name="buildQueue.no.currentTaks" />
           </c:if>
         </div>
-      </s:form>
+      
       
       <s:form id="removeBuildForm" action="removeBuildQueueEntries!removeBuildEntries.action" method="post">
         <div id="h3">
@@ -140,7 +140,7 @@
         </c:if>
       </s:form>
 
-      <s:form id="checkoutForm" action="none" method="post">
+      
         <%-- checkout queue --%>
         <div id="h3">
           <h3>
@@ -182,7 +182,7 @@
             <s:text name="checkoutQueue.no.currentTaks" />
           </c:if>
         </div>
-      </s:form>
+      
         
       <s:form id="removeCheckoutForm" action="removeCheckoutQueueEntries!removeCheckoutEntries.action" method="post">
         <div id="h3">
@@ -247,7 +247,7 @@
         </c:if>          
       </s:form>
 
-      <s:form id="prepareBuildForm" action="none" method="post">
+      
       	<div id="h3">
           <h3><s:text name="prepareBuildQueue.currentTask.section.title"/></h3>
           <c:if test="${not empty currentPrepareBuilds}">
@@ -276,7 +276,7 @@
             <s:text name="prepareBuildQueue.no.currentTasks"/>
           </c:if>
         </div>
-      </s:form>
+      
        
       <s:form id="removePrepareBuildForm" action="removePrepareBuildEntries.action" method="post">
         <div id="h3">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp Mon Aug  8 15:08:45 2011
@@ -37,7 +37,7 @@
         </div>
       </c:if>
       
-      <s:form id="buildForm" action="none" method="post">
+      
         <div id="h3">
           <h3><s:text name="distributedBuilds.currentBuild.section.title"/></h3>
           <c:if test="${not empty currentDistributedBuilds}">
@@ -78,8 +78,8 @@
             <s:text name="distributedBuilds.no.currentTasks"/>
           </c:if>
         </div>
-      </s:form>
-      <s:form id="removeBuildForm" action="removeDistributedBuildEntries.action" method="post">
+      
+      <s:form id="removeBuildForm" action="removeDistributedBuildEntries!removeDistributedBuildEntries.action" method="post">
         <div id="h3">
           <h3>
             <s:text name="distributedBuilds.buildQueue.section.title"/>
@@ -143,7 +143,7 @@
           <s:text name="distributedBuilds.empty"/>
         </c:if>
       </s:form>
-      <s:form id="prepareForm" action="none" method="post">
+      
         <div id="h3">
           <h3><s:text name="distributedBuilds.currentPrepareBuild.section.title"/></h3>
           <c:if test="${not empty currentDistributedPrepareBuilds}">
@@ -172,9 +172,9 @@
             <s:text name="distributedPrepareBuilds.no.currentTasks"/>
           </c:if>
         </div>
-      </s:form>
       
-      <s:form id="removePrepareBuildForm" action="removeDistributedPrepareBuildEntries.action" method="post">
+      
+      <s:form id="removePrepareBuildForm" action="removeDistributedPrepareBuildEntries!removeDistributedPrepareBuildEntries.action" method="post">
         <div id="h3">
           <h3>
             <s:text name="distributedBuilds.prepareBuildQueue.section.title"/>

Modified: continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java?rev=1154984&r1=1154983&r2=1154984&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java (original)
+++ continuum/trunk/continuum-webapp/src/test/java/org/apache/maven/continuum/web/action/BuildAgentActionTest.java Mon Aug  8 15:08:45 2011
@@ -67,7 +67,7 @@ public class BuildAgentActionTest
         configurationServiceMock.expects( once() ).method( "addBuildAgent" ).isVoid();
         configurationServiceMock.expects( once() ).method( "store" ).isVoid();
         continuumMock.expects( once() ).method( "getDistributedBuildManager" ).will( returnValue( distributedBuildManagerMock.proxy() ) );
-        distributedBuildManagerMock.expects( once() ).method( "reload" ).isVoid();
+        distributedBuildManagerMock.expects( once() ).method( "update" ).isVoid();
         
         BuildAgentConfiguration buildAgent = new BuildAgentConfiguration();
         buildAgent.setUrl( "http://sample/agent" );



Mime
View raw message