continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r726610 - in /continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum: buildmanager/ParallelBuildsManager.java taskqueue/DefaultOverallBuildQueue.java
Date Mon, 15 Dec 2008 03:27:24 GMT
Author: oching
Date: Sun Dec 14 19:27:23 2008
New Revision: 726610

URL: http://svn.apache.org/viewvc?rev=726610&view=rev
Log:
more code/comments cleanup

Modified:
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java

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=726610&r1=726609&r2=726610&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
Sun Dec 14 19:27:23 2008
@@ -60,17 +60,7 @@
  */
 public class ParallelBuildsManager
     implements BuildsManager, Contextualizable
-{
-    // TODO: deng parallel builds
-    // - move prepare build queue to parallel builds manager instead of moving it back to
the
-    //      task queue manager
-    // - prepare build queue must be a singleton, not per lookup, as we are maintaining only
one
-    //      prepare build queue :) <-- changed my mind, prepare build queue should be
here except it
-    //      should be a singleton and not added in the overallbuildqueue!
-    
-    // NOTE: maybe we could also use the default build definition template? 
-    // - take a look at AddProjectTest (add-projects-from-metadata)
-    
+{    
     private Logger log = LoggerFactory.getLogger( ParallelBuildsManager.class );
         
     // map must be synchronized!
@@ -251,12 +241,6 @@
                     log.warn( "Project not found in any of the build queues." );
                 }
             }
-            /*catch ( TaskQueueException e )
-            {
-                log.error( "Cannot cancel build on build queue '" + overallBuildQueue.getName()
+ "'." );
-                throw new BuildManagerException( "Cannot cancel build on build queue '" +
overallBuildQueue.getName() +
-                                 "': " + e.getMessage() );
-            }   */
             catch ( ComponentLookupException e )
             {
                 log.error( e.getMessage() );
@@ -281,13 +265,7 @@
                     overallBuildQueue = overallBuildQueues.get( key );                
                     overallBuildQueue.cancelCurrentBuild();                
                 }
-            }
-            /*catch ( TaskQueueException e )
-            {
-                log.error( "Cannot cancel build on build queue '" + overallBuildQueue.getName()
+ "'." );
-                throw new BuildManagerException( "Cannot cancel build on build queue '" +
overallBuildQueue.getName() +
-                                 "': " + e.getMessage() );
-            }  */         
+            }        
             catch ( ComponentLookupException e )
             {
                 log.error( e.getMessage() );

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=726610&r1=726609&r2=726610&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
Sun Dec 14 19:27:23 2008
@@ -46,15 +46,7 @@
 public class DefaultOverallBuildQueue
     extends AbstractLogEnabled
     implements OverallBuildQueue
-    //, Contextualizable 
-{
-    // TODO: deng parallel builds
-    // - might need to set a task queue executor for each task queue! 
-    //      change getXXXXTaskQueueExecutor() methods
-    
-    // TODO:
-    // - need to specify each task queue to be instantiated each time it is looked up!!!
-
+{   
     /**
      * @plexus.requirement role-hint="build-project"
      */
@@ -323,27 +315,6 @@
         return buildQueue.getQueueSnapshot();        
     }
 
-    /*public boolean isBuildInProgress()
-        throws TaskQueueException
-    {
-        try
-        {
-            Task task = getCurrentTask( "build-project" );
-    
-            if ( task != null && task instanceof BuildProjectTask )
-            {
-                return true;
-            }
-        }
-        catch( ComponentLookupException e )
-        {
-            // should we wrap this in a different exception instead of a TaskQueueException
-            throw new TaskQueueException( e.getMessage() );
-        }
-        
-        return false;
-    }*/
-
     public boolean isInBuildQueue( int projectId )
         throws TaskQueueException
     {
@@ -376,7 +347,6 @@
                 }
             }
         }
-
         return false;
     }
 
@@ -400,26 +370,8 @@
                     getLogger().info( "current task is a BuildProjectTask." );
                 }
             }
-        }            
-        
+        }           
         
-        /*try
-        {
-            Task currentTask = getBuildTaskQueueExecutor().getCurrentTask();
-    
-            if ( currentTask instanceof BuildProjectTask )
-            {
-                if ( ( (BuildProjectTask) currentTask ).getProjectId() == projectId )
-                {
-                    getLogger().info( "Cancelling task for project " + projectId );
-                    getBuildTaskQueueExecutor().cancelTask( currentTask );
-                }
-            }
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new TaskQueueException( e.getMessage() );
-        }*/
     }
 
     public boolean cancelCurrentBuild()
@@ -441,33 +393,6 @@
                 getLogger().info( "current task is a BuildProjectTask." );
             }
         }
-        
-        /*try
-        {
-            Task task = getBuildTaskQueueExecutor().getCurrentTask();
-    
-            if ( task != null )
-            {
-                if ( task instanceof BuildProjectTask )
-                {
-                    getLogger().info( "Cancelling current build task" );
-                    return getBuildTaskQueueExecutor().cancelTask( task );
-                }
-                else
-                {
-                    getLogger().warn( "Current task not a BuildProjectTask - not cancelling"
);
-                }
-            }
-            else
-            {
-                getLogger().warn( "No task running - not cancelling" );
-            }
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new TaskQueueException( e.getMessage() );
-        }*/
-        
         return false;
     }
 
@@ -569,12 +494,6 @@
         }
     }
 
-    /*public void contextualize( Context context )
-        throws ContextException
-    {
-        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
-    }*/
-
     public TaskQueue getCheckoutQueue()
     {
         return checkoutQueue;
@@ -589,12 +508,4 @@
     {
         this.container = container;
     }
-    // TODO: change this!
-    /*private Task getCurrentTask( String task )
-        throws ComponentLookupException
-    {
-        
-        TaskQueueExecutor executor = (TaskQueueExecutor) container.lookup( TaskQueueExecutor.class,
task );
-        return executor.getCurrentTask();       
-    }    */
 }



Mime
View raw message