continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r734051 - in /continuum/branches/continuum-parallel-builds: continuum-commons/src/main/resources/META-INF/ continuum-core/ continuum-core/src/main/java/org/apache/continuum/buildmanager/ continuum-core/src/main/java/org/apache/continuum/tas...
Date Tue, 13 Jan 2009 06:26:05 GMT
Author: oching
Date: Mon Jan 12 22:25:59 2009
New Revision: 734051

URL: http://svn.apache.org/viewvc?rev=734051&view=rev
Log:
switched over new classes to use java/spring annotations instead of plexus

Modified:
    continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
    continuum/branches/continuum-parallel-builds/continuum-core/pom.xml
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/resources/META-INF/spring-context.xml
    continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java

Modified: continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-commons/src/main/resources/META-INF/spring-context.xml
Mon Jan 12 22:25:59 2009
@@ -35,15 +35,12 @@
   <bean id="configurationService" class="org.apache.maven.continuum.configuration.DefaultConfigurationService"
         init-method="initialize">
     <property name="applicationHome" value="data"/>
-    <!-- 
-    <property name="scheduleDao" ref="scheduleDao"/>
-    <property name="systemConfigurationDao" ref="systemConfigurationDao"/>
-    <property name="configuration" ref="continuumConfiguration"/>
-    <property name="buildQueueService" ref="buildQueueService"/>   -->
   </bean>
+  
   <bean id="buildQueueService" class="org.apache.continuum.buildqueue.DefaultBuildQueueService">
     <property name="buildQueueDao" ref="buildQueueDao"/>
     <property name="scheduleDao" ref="scheduleDao"/>
   </bean> 
+  
   <bean id="shellCommandHelper" class="org.apache.continuum.utils.shell.DefaultShellCommandHelper"/>
 
 </beans>
\ No newline at end of file

Modified: continuum/branches/continuum-parallel-builds/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/pom.xml?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/pom.xml (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/pom.xml Mon Jan 12 22:25:59
2009
@@ -130,6 +130,10 @@
       <artifactId>jpox</artifactId>
     </dependency>
     <dependency>
+      <groupId>javax.annotation</groupId>
+      <artifactId>jsr250-api</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-store</artifactId>
     </dependency>

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
Mon Jan 12 22:25:59 2009
@@ -26,6 +26,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.annotation.Resource;
+
 import org.apache.continuum.buildqueue.BuildQueueService;
 import org.apache.continuum.buildqueue.BuildQueueServiceException;
 import org.apache.continuum.dao.BuildDefinitionDao;
@@ -59,7 +61,7 @@
  * Parallel builds manager. 
  * 
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
- * @plexus.component role="org.apache.continuum.buildmanager.BuildsManager" role-hint="parallel"
+ * @version $Id$
  */
 public class ParallelBuildsManager    
     implements BuildsManager, Contextualizable
@@ -74,24 +76,15 @@
 
     private static final int CHECKOUT_QUEUE = 2;
 
-    /**
-     * @plexus.requirement
-     */
+    @Resource
     private BuildDefinitionDao buildDefinitionDao;
 
-    /**
-     * @plexus.requirement role-hint="prepare-build-project"
-     */
     private TaskQueue prepareBuildQueue;
 
-    /**
-     * @plexus.requirement
-     */
+    @Resource
     private ConfigurationService configurationService;
         
-    /**
-     * @plexus.requirement
-     */
+    @Resource
     private BuildQueueService buildQueueService;
 
     private PlexusContainer container;
@@ -315,7 +308,6 @@
                         }
                     }
                     log.error( "Project '" + projectId + "' not found in any of the builds
queues." );
-                    //throw new BuildManagerException( "Project not found in any of the build
queues." );
                 }
             }
         }
@@ -356,7 +348,6 @@
                         }
                     }
                     log.info( "Project '" + projectId + "' not found in any of the checkout
queues." );
-                    //throw new BuildManagerException( "Project not found in any of the checkout
queues." );
                 }
             }
         }
@@ -545,8 +536,6 @@
     {
         try
         {            
-            //PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( projectsBuildDefinitionsMap,
trigger );
-            
             PrepareBuildProjectsTask task =
                 new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, trigger, projectGroupId,
scmRootAddress );
             
@@ -576,7 +565,6 @@
             else
             {
                 log.info( "Project '" + projectId + "' not found in any of the build queues."
);
-                //throw new BuildManagerException( "Project not found in any of the build
queues." );
             }
         }
         catch ( TaskQueueException e )
@@ -602,7 +590,6 @@
             else
             {
                 log.info( "Project '" + projectId + "' not found in any of the build queues."
);
-                //throw new BuildManagerException( "Project not found in any of the build
queues." );
             }
         }
         catch ( TaskQueueException e )
@@ -628,7 +615,6 @@
             else
             {
                 log.info( "Project '" + projectId + "' not found in any of the checkout queues."
);
-                //throw new BuildManagerException( "Project not found in any of the checkout
queues." );
             }
         }
         catch ( TaskQueueException e )
@@ -1195,11 +1181,6 @@
         return whereToBeQueued;
     }
     
-    public void setBuildDefinitionDao( BuildDefinitionDao buildDefinitionDao )
-    {
-        this.buildDefinitionDao = buildDefinitionDao;
-    }
-
     public void contextualize( Context context )
         throws ContextException
     {
@@ -1252,17 +1233,22 @@
         return overallBuildQueue;
     }
     
-    // for unit tests..
-    
-    public void setOverallBuildQueues( Map<Integer, OverallBuildQueue> overallBuildQueues
)
+    public TaskQueue getPrepareBuildQueue()
     {
-        this.overallBuildQueues = overallBuildQueues;
+        return prepareBuildQueue;
     }
-
+    
     public void setPrepareBuildQueue( TaskQueue prepareBuildQueue )
     {
         this.prepareBuildQueue = prepareBuildQueue;
     }
+    
+    // for unit tests.. 
+    
+    public void setOverallBuildQueues( Map<Integer, OverallBuildQueue> overallBuildQueues
)
+    {
+        this.overallBuildQueues = overallBuildQueues;
+    }
 
     public void setConfigurationService( ConfigurationService configurationService )
     {
@@ -1273,4 +1259,9 @@
     {
         this.buildQueueService = buildQueueService;
     }
+    
+    public void setBuildDefinitionDao( BuildDefinitionDao buildDefinitionDao )
+    {
+        this.buildDefinitionDao = buildDefinitionDao;
+    }
 }

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
Mon Jan 12 22:25:59 2009
@@ -22,6 +22,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.annotation.Resource;
+
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
@@ -41,24 +43,16 @@
  * "Overall" build queue which has a checkout queue and a build queue.
  * 
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
- * @plexus.component role="org.apache.continuum.taskqueue.OverallBuildQueue" instantiation-strategy="per-lookup"
+ * @version $Id$
  */
 public class DefaultOverallBuildQueue   
     implements OverallBuildQueue
 {
-    /**
-     * @plexus.requirement
-     */
+    @Resource
     private BuildDefinitionDao buildDefinitionDao;
     
-    /**
-     * @plexus.requirement role-hint="build-project"
-     */
     private TaskQueueExecutor buildTaskQueueExecutor;
     
-    /**
-     * @plexus.requirement role-hint="check-out-project"
-     */
     private TaskQueueExecutor checkoutTaskQueueExecutor;
 
     private int id;

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueueexecutor/ParallelBuildsThreadedTaskQueueExecutor.java
Mon Jan 12 22:25:59 2009
@@ -42,7 +42,7 @@
 import edu.emory.mathcs.backport.java.util.concurrent.TimeoutException;
 
 /**
- * 
+ * Modified plexus ThreadedTaskQueueExecutor
  */
 public class ParallelBuildsThreadedTaskQueueExecutor
     implements TaskQueueExecutor, Initializable, Startable
@@ -50,16 +50,22 @@
     private static final int SHUTDOWN = 1;
 
     private static final int CANCEL_TASK = 2;
-    
+
     private Logger log = LoggerFactory.getLogger( getClass() );
 
-    /** @requirement */
+    /**
+     * @requirement 
+     */
     private TaskQueue queue;
 
-    /** @requirement */
+    /**
+     * @requirement 
+     */
     private TaskExecutor executor;
 
-    /** @configuration */
+    /**
+     * @configuration 
+     */
     private String name;
 
     // ----------------------------------------------------------------------
@@ -93,8 +99,8 @@
                 }
                 catch ( InterruptedException e )
                 {
-                    log.info( "Executor thread interrupted, command: "
-                        + ( command == SHUTDOWN ? "Shutdown" : command == CANCEL_TASK ? "Cancel
task" : "Unknown" ) );
+                    log.info( "Executor thread interrupted, command: " +
+                        ( command == SHUTDOWN ? "Shutdown" : command == CANCEL_TASK ? "Cancel
task" : "Unknown" ) );
                     continue;
                 }
 
@@ -214,8 +220,8 @@
                 }
                 else
                 {
-                    log.warn( "Task not cancelled (Flags: done: " + future.isDone() + " cancelled:
"
-                        + future.isCancelled() + ")" );
+                    log.warn( "Task not cancelled (Flags: done: " + future.isDone() + " cancelled:
" +
+                        future.isCancelled() + ")" );
                 }
             }
             else
@@ -281,7 +287,6 @@
     {
         log.info( "Starting task executor, thread name '" + name + "'." );
 
-        //this.executorService = Executors.newSingleThreadExecutor();
         this.executorService = Executors.newCachedThreadPool();
 
         executorRunnable = new ExecutorRunnable();

Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/resources/META-INF/spring-context.xml?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/resources/META-INF/spring-context.xml
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/resources/META-INF/spring-context.xml
Mon Jan 12 22:25:59 2009
@@ -33,4 +33,14 @@
     </property>
   </bean>
   
+  <bean name="buildsManager#parallel" 
+  		class="org.apache.continuum.buildmanager.ParallelBuildsManager" autowire="byName">
+     <property name="prepareBuildQueue" ref="taskQueue#prepare-build-project"/>
+  </bean>
+    
+  <bean name="overallBuildQueue" 
+  		class="org.apache.continuum.taskqueue.DefaultOverallBuildQueue" scope="prototype" autowire="byName">
+     <property name="buildTaskQueueExecutor" ref="taskQueueExecutor#build-project"/>
+     <property name="checkoutTaskQueueExecutor" ref="taskQueueExecutor#check-out-project"/>
+  </bean>
 </beans>

Modified: continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java?rev=734051&r1=734050&r2=734051&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
(original)
+++ continuum/branches/continuum-parallel-builds/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/BuildQueueAction.java
Mon Jan 12 22:25:59 2009
@@ -32,7 +32,6 @@
  * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="buildQueueAction"
  */
 public class BuildQueueAction
-    //extends AbstractBuildQueueAction
     extends ContinuumActionSupport
     implements Preparable
 {



Mime
View raw message