continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r725574 - in /continuum/branches/continuum-distributed-builds: continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-api/src/main/java/org/apache/continuum/scm/queue/ continuum-api/src/main/java/org/apache/...
Date Thu, 11 Dec 2008 04:46:51 GMT
Author: ctan
Date: Wed Dec 10 20:46:50 2008
New Revision: 725574

URL: http://svn.apache.org/viewvc?rev=725574&view=rev
Log:
- added view distributed build queue
- more fixes on implementation

Modified:
    continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
    continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/scm/queue/PrepareBuildProjectsTask.java
    continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
    continuum/branches/continuum-distributed-builds/continuum-builder/pom.xml
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
    continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
    continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp

Modified: continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
Wed Dec 10 20:46:50 2008
@@ -23,7 +23,8 @@
     void reload()
         throws ContinuumException;
     
-    void removeAgentFromTaskQueueExecutor( String buildAgentUrl );
+    void removeAgentFromTaskQueueExecutor( String buildAgentUrl )
+        throws ContinuumException;
 
     boolean isBuildAgentBusy( String buildAgentUrl );
 

Modified: continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/scm/queue/PrepareBuildProjectsTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/scm/queue/PrepareBuildProjectsTask.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/scm/queue/PrepareBuildProjectsTask.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/scm/queue/PrepareBuildProjectsTask.java
Wed Dec 10 20:46:50 2008
@@ -13,14 +13,17 @@
 
     private int projectGroupId;
 
+    private String projectGroupName;
+
     private String scmRootAddress;
 
     public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap,
int trigger,
-                                     int projectGroupId, String scmRootAddress )
+                                     int projectGroupId, String projectGroupName, String
scmRootAddress )
     {
         this.projectsBuildDefinitionsMap = projectsBuildDefinitionsMap;
         this.trigger = trigger;
         this.projectGroupId = projectGroupId;
+        this.projectGroupName = projectGroupName;
         this.scmRootAddress = scmRootAddress;
     }
     
@@ -65,6 +68,16 @@
         this.projectGroupId = projectGroupId;
     }
 
+    public String getProjectGroupName()
+    {
+        return projectGroupName;
+    }
+
+    public void setProjectGroupName( String projectGroupName )
+    {
+        this.projectGroupName = projectGroupName;
+    }
+
     public String getScmRootAddress()
     {
         return scmRootAddress;

Modified: continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-api/src/main/java/org/apache/continuum/taskqueue/manager/TaskQueueManager.java
Wed Dec 10 20:46:50 2008
@@ -2,6 +2,7 @@
 
 import java.util.List;
 
+import org.apache.continuum.scm.queue.PrepareBuildProjectsTask;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
@@ -40,6 +41,9 @@
 
     TaskQueue getDistributedBuildQueue();
 
+    List<PrepareBuildProjectsTask> getDistributedBuildProjectsInQueue()
+        throws TaskQueueManagerException;
+
     TaskQueue getPrepareBuildQueue();
 
     TaskQueueExecutor getPrepareBuildTaskQueueExecutor()

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/pom.xml?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/pom.xml (original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/pom.xml Wed Dec 10 20:46:50
2008
@@ -77,26 +77,4 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-  <!-- build>
-    <plugins>
-      <plugin>
-        <groupId>org.codehaus.plexus</groupId>
-        <artifactId>plexus-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>generate</id>
-            <goals>
-              <goal>descriptor</goal>
-            </goals>
-          </execution>
-          <execution>
-            <id>merge</id>
-            <goals>
-              <goal>merge-descriptors</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build -->
 </project>

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
Wed Dec 10 20:46:50 2008
@@ -26,7 +26,6 @@
 import org.apache.xmlrpc.XmlRpcException;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -91,17 +90,14 @@
         }
         catch ( MalformedURLException e )
         {
-            log.error( "Invalid URL " + buildAgentUrl, e );
-            endTime = System.currentTimeMillis();
-            createBuildResult( prepareBuildTask.getProjectsBuildDefinitionsMap(), prepareBuildTask.getTrigger(),
-                                    ContinuumUtils.throwableToString( e ) );
+            log.error( "Invalid URL " + buildAgentUrl + ", not building" );
+            throw new TaskExecutionException( "Invalid URL " + buildAgentUrl, e );
         }
         catch ( Exception e )
         {
-            log.error( "Error occurred while performing task", e );
+            log.error( "Error occurred while building task", e );
             endTime = System.currentTimeMillis();
-            createBuildResult( prepareBuildTask.getProjectsBuildDefinitionsMap(), prepareBuildTask.getTrigger(),
-                               ContinuumUtils.throwableToString( e ) );
+            createResult( prepareBuildTask, ContinuumUtils.throwableToString( e ) );
         }
     }
 
@@ -178,32 +174,45 @@
         }
     }
 
-    private void createBuildResult( Map<Integer, Integer> map, int trigger, String
error )
+    private void createResult( PrepareBuildProjectsTask task, String error )
         throws TaskExecutionException
     {
         try
         {
-            for ( Integer projectId : map.keySet() )
-            {
-                int buildDefinitionId = map.get( projectId );
-                Project project = projectDao.getProject( projectId );
-                BuildDefinition buildDef = buildDefinitionDao.getBuildDefinition( buildDefinitionId
);
+            ProjectScmRoot scmRoot = projectScmRootDao.getProjectScmRootByProjectGroupAndScmRootAddress(
task.getProjectGroupId(), task.getScmRootAddress() );
 
-                BuildResult latestBuildResult = buildResultDao.
-                                                    getLatestBuildResultForBuildDefinition(
projectId, buildDefinitionId );
-                if ( ( latestBuildResult.getStartTime() >= startTime && latestBuildResult.getEndTime()
> 0 && 
-                       latestBuildResult.getEndTime() < endTime ) || latestBuildResult.getStartTime()
< startTime )
+            if ( scmRoot.getState() == ContinuumProjectState.UPDATING )
+            {
+                scmRoot.setState( ContinuumProjectState.ERROR );
+                scmRoot.setError( error );
+                projectScmRootDao.updateProjectScmRoot( scmRoot );
+            }
+            else
+            {
+                Map<Integer, Integer> map = task.getProjectsBuildDefinitionsMap();
+                for ( Integer projectId : map.keySet() )
                 {
-                    BuildResult buildResult = new BuildResult();
-                    buildResult.setBuildDefinition( buildDef );
-                    buildResult.setError( error );
-                    buildResult.setState( ContinuumProjectState.ERROR );
-                    buildResult.setTrigger( trigger );
-                    buildResult.setStartTime( startTime );
-                    buildResult.setEndTime( endTime );
+                    int buildDefinitionId = map.get( projectId );
+                    Project project = projectDao.getProject( projectId );
+                    BuildDefinition buildDef = buildDefinitionDao.getBuildDefinition( buildDefinitionId
);
+
+                    BuildResult latestBuildResult = buildResultDao.
+                                                        getLatestBuildResultForBuildDefinition(
projectId, buildDefinitionId );
+                    if ( ( latestBuildResult.getStartTime() >= startTime && latestBuildResult.getEndTime()
> 0 && 
+                           latestBuildResult.getEndTime() < endTime ) || latestBuildResult.getStartTime()
< startTime )
+                    {
+                        BuildResult buildResult = new BuildResult();
+                        buildResult.setBuildDefinition( buildDef );
+                        buildResult.setError( error );
+                        buildResult.setState( ContinuumProjectState.ERROR );
+                        buildResult.setTrigger( task.getTrigger() );
+                        buildResult.setStartTime( startTime );
+                        buildResult.setEndTime( endTime );
 
-                    buildResultDao.addBuildResult( project, buildResult );
+                        buildResultDao.addBuildResult( project, buildResult );
+                    }
                 }
+
             }
         }
         catch ( ContinuumStoreException e )

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
Wed Dec 10 20:46:50 2008
@@ -38,6 +38,8 @@
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -175,9 +177,23 @@
     }
 
     public void removeAgentFromTaskQueueExecutor( String buildAgentUrl)
+        throws ContinuumException
     {
         log.info( "remove TaskQueueExecutor for build agent '" + buildAgentUrl + "'" );
-        taskQueueExecutors.remove( buildAgentUrl );
+        ThreadedDistributedBuildTaskQueueExecutor executor = taskQueueExecutors.get( buildAgentUrl
);
+
+        try
+        {
+            if ( taskQueueExecutors.remove( buildAgentUrl ) != null )
+            {
+                Startable startable = (Startable) executor;
+                executor.stop();
+            }
+        }
+        catch ( StoppingException e )
+        {
+            throw new ContinuumException( "", e );
+        }
     }
 
     public boolean isBuildAgentBusy( String buildAgentUrl )

Modified: continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-builder/src/main/resources/META-INF/plexus/components.xml
Wed Dec 10 20:46:50 2008
@@ -60,6 +60,7 @@
       <role>org.apache.continuum.builder.distributed.executor.DistributedBuildTaskExecutor</role>
       <role-hint>distributed-build-project</role-hint>
       <implementation>org.apache.continuum.builder.distributed.executor.DistributedBuildProjectTaskExecutor</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
       <requirements>
         <requirement>
           <role>org.apache.continuum.dao.ProjectDao</role>
@@ -97,4 +98,4 @@
     </component>
 
   </components>
-</component-set>
\ No newline at end of file
+</component-set>

Modified: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
Wed Dec 10 20:46:50 2008
@@ -27,11 +27,6 @@
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
 import org.apache.maven.continuum.model.project.Schedule;
-import org.codehaus.plexus.PlexusConstants;
-import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.context.Context;
-import org.codehaus.plexus.context.ContextException;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 
 import java.util.List;

Modified: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/manager/DefaultTaskQueueManager.java
Wed Dec 10 20:46:50 2008
@@ -250,6 +250,19 @@
         return distributedBuildQueue;
     }
 
+    public List<PrepareBuildProjectsTask> getDistributedBuildProjectsInQueue()
+        throws TaskQueueManagerException
+    {
+        try
+        {
+            return distributedBuildQueue.getQueueSnapshot();
+        }
+        catch ( TaskQueueException e )
+        {
+            throw new TaskQueueManagerException( "Error while getting the distributed building
queue", e );
+        }
+    }
+
     public TaskQueue getPrepareBuildQueue()
     {
         return prepareBuildQueue;

Modified: continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Wed Dec 10 20:46:50 2008
@@ -3343,8 +3343,9 @@
                                        String scmRootAddress, int projectGroupId )
         throws ContinuumException
     {
+        ProjectGroup group = getProjectGroup( projectGroupId );
         PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( projectsBuildDefinitionsMap,
trigger,
-                                                                      projectGroupId, scmRootAddress
);
+                                                                      projectGroupId, group.getName(),
scmRootAddress );
 
         try
         {

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java
Wed Dec 10 20:46:50 2008
@@ -20,7 +20,6 @@
  */
 
 import org.apache.continuum.configuration.BuildAgentConfiguration;
-import org.apache.continuum.builder.distributed.BuildAgentListener;
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.system.Installation;
@@ -159,26 +158,7 @@
         {
             distributedBuildManager.removeAgentFromTaskQueueExecutor( buildAgent.getUrl()
);
         }
-        /*
-        List<BuildAgentListener> listeners = distributedBuildManager.getBuildAgentListeners();
 
-        for ( BuildAgentListener listener : listeners )
-        {
-            if ( listener.getUrl().equals( buildAgent.getUrl() ) )
-            {
-                if ( listener.isBusy() )
-                {
-                    message = getText( "buildAgent.error.delete.busy" );
-                    return ERROR;
-                }
-                else
-                {
-                    listeners.remove( listener );
-                    break;
-                }
-            }
-        }*/
-        
         ConfigurationService configuration = getContinuum().getConfiguration();
 
         for ( BuildAgentConfiguration agent : configuration.getBuildAgents() )

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
Wed Dec 10 20:46:50 2008
@@ -21,6 +21,7 @@
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
+import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
 import org.codehaus.plexus.spring.PlexusToSpringUtils;
@@ -81,6 +82,9 @@
 
         TaskQueueExecutor prepareBuildProject = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
             .buildSpringId( TaskQueueExecutor.class, "prepare-build-project" ) );
+
+        DistributedBuildManager distributedBuildManager = (DistributedBuildManager) wac.getBean(
PlexusToSpringUtils
+            .buildSpringId( DistributedBuildManager.class ) );
     }
 
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
Wed Dec 10 20:46:50 2008
@@ -24,10 +24,7 @@
 import java.util.Map;
 
 import org.apache.commons.lang.ArrayUtils;
-import org.apache.continuum.builder.distributed.BuildAgentListener;
 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
-import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.continuum.scm.queue.PrepareBuildProjectsTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
 import org.apache.maven.continuum.Continuum;
@@ -42,7 +39,6 @@
 import org.apache.maven.continuum.web.model.DistributedBuildSummary;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.redback.rbac.Resource;
-import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
@@ -102,6 +98,8 @@
 
     private List<DistributedBuildSummary> distributedBuildSummary;
 
+    private List<PrepareBuildProjectsTask> distributedBuildQueues;
+
     private String buildAgentUrl;
 
     private int projectGroupId;
@@ -225,6 +223,8 @@
                distributedBuildSummary.add( summary );
             }
 
+            distributedBuildQueues = taskQueueManager.getDistributedBuildProjectsInQueue();
+
             return DISTRIBUTED_BUILD_SUCCESS;
         }
         else
@@ -500,4 +500,14 @@
     {
         this.buildAgentUrl = buildAgentUrl;
     }
+
+    public List<PrepareBuildProjectsTask> getDistributedBuildQueues()
+    {
+        return distributedBuildQueues;
+    }
+
+    public void setDistributedBuildQueues( List<PrepareBuildProjectsTask> distributedBuildQueues
)
+    {
+        this.distributedBuildQueues = distributedBuildQueues;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Dec 10 20:46:50 2008
@@ -989,7 +989,9 @@
 # Page: View Distributed Build
 # ----------------------------------------------------------------------
 distributedBuilds.page.title = Continuum - View Distributed Builds
-distributedBuilds.section.title = View Distributed Builds
+distributedBuilds.section.title = Distributed Builds
+distributedBuilds.buildQueue.section.title = Build Queue
 distributedBuild.table.projectGroupName = Project Group Name
 distributedBuild.table.scmRootAddress = Scm Root Address
-distributedBuild.table.agentUrl = Build Agent URL
\ No newline at end of file
+distributedBuild.table.agentUrl = Build Agent URL
+distributedBuilds.empty = No Distributed Builds
\ No newline at end of file

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/viewDistributedBuilds.jsp
Wed Dec 10 20:46:50 2008
@@ -37,9 +37,9 @@
             </s:iterator>
           </div>
         </c:if>
-        <c:if test="${not empty distributedBuilds}">
-          <s:set name="distributedBuilds" value="distributedBuilds" scope="request"/>
-          <ec:table items="distributedBuilds"
+        <c:if test="${not empty distributedBuildSummary}">
+          <s:set name="distributedBuildSummary" value="distributedBuildSummary" scope="request"/>
+          <ec:table items="distributedBuildSummary"
                     var="distributedBuild"
                     showExports="false"
                     showPagination="false"
@@ -61,12 +61,35 @@
             </ec:row>
           </ec:table>
         </c:if>
-        <c:if test="${empty distributedBuilds}">
+        <c:if test="${empty distributedBuildSummary}">
           <s:text name="distributedBuilds.empty"/>
         </c:if>
       </div>
       <div id="h3">
-      
+        <h3>
+            <s:text name="distributedBuilds.buildQueue.section.title"/>
+          </h3>
+        <c:if test="${not empty distributedBuildQueues}">
+          <ec:table items="distributedBuildQueues"
+                    var="distributedBuildQueue"
+                    showExports="false"
+                    showPagination="false"
+                    showStatusBar="false"
+                    sortable="false"
+                    filterable="false">
+            <ec:row>
+              <ec:column property="projectGroupName" title="distributedBuild.table.projectGroupName"/>
+              <ec:column property="scmRootAddress" title="distributedBuild.table.scmRootAddress"/>
+              <ec:column property="cancelEntry" title="&nbsp;" width="1%">
+                <s:url id="cancelUrl" action="removeDistributedBuild" method="removeDistributedBuild"
namespace="/">
+                  <s:param name="projectGroupId">${pageScope.distributedBuild.projectGroupId}</s:param>
+                  <s:param name="scmRootAddress">${pageScope.distributedBuild.scmRootAddress}</s:param>
+                </s:url>
+                <s:a href="%{cancelUrl}"><img src="<s:url value='/images/cancelbuild.gif'
includeParams="none"/>" alt="<s:text name='cancel'/>" title="<s:text name='cancel'/>"
border="0"></s:a>
+              </ec:column>
+            </ec:row>
+          </ec:table>
+        </c:if>
       </div>
     </body>
   </s:i18n>

Modified: continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp?rev=725574&r1=725573&r2=725574&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-webapp/src/main/webapp/WEB-INF/jsp/navigations/Menu.jsp
Wed Dec 10 20:46:50 2008
@@ -158,12 +158,14 @@
             </s:a>
           </div>
         </redback:ifAuthorized>
+        <redback:ifAuthorized permission="continuum-manage-distributed-builds">
           <s:url id="buildAgentList" action="buildAgentList" namespace="/security" includeParams="none"/>
           <div class="body">
             <s:a href="%{buildAgentList}">
               <s:text name="menu.administration.buildAgents"/>
             </s:a>
           </div>
+        </redback:ifAuthorized>
         <redback:ifAuthorized permission="continuum-manage-distributed-builds">
         </redback:ifAuthorized>
         <redback:ifAuthorized permission="continuum-manage-users">



Mime
View raw message