continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r179629 - in /maven/continuum/trunk/continuum-core: ./ src/main/java/org/apache/maven/continuum/core/action/
Date Thu, 02 Jun 2005 19:16:57 GMT
Author: trygvis
Date: Thu Jun  2 12:16:55 2005
New Revision: 179629

URL: http://svn.apache.org/viewcvs?rev=179629&view=rev
Log:
o Removing ContinuumAction for Action from plexus-action.

Removed:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ContinuumAction.java
Modified:
    maven/continuum/trunk/continuum-core/pom.xml
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/BuildProjectsFromMetadataAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectMetadataContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java

Modified: maven/continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/pom.xml?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/pom.xml Thu Jun  2 12:16:55 2005
@@ -48,6 +48,11 @@
       <artifactId>plexus-mail-sender-api</artifactId>
       <version>1.0-alpha-1</version>
     </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-action</artifactId>
+      <version>1.0-alpha-1</version>
+    </dependency>
 
     <!--
      |

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Thu Jun  2 12:16:55 2005
@@ -21,14 +21,15 @@
 
 import org.apache.maven.continuum.core.ContinuumCore;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
-import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.UpdateScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
+import org.codehaus.plexus.action.Action;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
@@ -37,7 +38,7 @@
  */
 public abstract class AbstractContinuumAction
     extends AbstractLogEnabled
-    implements ContinuumAction
+    implements Action
 {
     // ----------------------------------------------------------------------
     // Keys for the values that can be in the context
@@ -83,26 +84,6 @@
     //
     // ----------------------------------------------------------------------
 
-    protected abstract void doExecute( Map context )
-        throws Exception;
-
-//    protected abstract void handleException( Throwable throwable )
-//        throws ContinuumStoreException;
-
-    protected void handleContinuumStoreException( ContinuumStoreException exception )
-    {
-        getLogger().fatalError( "Error using the store.", exception );
-    }
-
-    protected void doFinally()
-        throws ContinuumStoreException
-    {
-    }
-
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
-
     protected ContinuumCore getCore()
     {
         return core;
@@ -175,45 +156,6 @@
     protected UpdateScmResult getUpdateScmResult(  Map context, UpdateScmResult defaultValue
)
     {
         return (UpdateScmResult) getObject( context, KEY_UPDATE_SCM_RESULT, defaultValue
);
-    }
-
-    // ----------------------------------------------------------------------
-    // ContinuumAction Implementatin
-    // ----------------------------------------------------------------------
-
-    public void execute( Map context )
-    {
-        try
-        {
-            doExecute( context );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            handleContinuumStoreException( e );
-        }
-        catch ( Exception e )
-        {
-            throw new RuntimeException( "Error while executing action.", e );
-//            try
-//            {
-//                handleException( e );
-//            }
-//            catch ( ContinuumStoreException e2 )
-//            {
-//                handleContinuumStoreException( e2 );
-//            }
-        }
-        finally
-        {
-            try
-            {
-                doFinally();
-            }
-            catch ( ContinuumStoreException e )
-            {
-                handleContinuumStoreException( e );
-            }
-        }
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
Thu Jun  2 12:16:55 2005
@@ -16,13 +16,12 @@
  * limitations under the License.
  */
 
-import java.util.Map;
 import java.io.File;
+import java.util.Map;
 
-import org.apache.maven.continuum.scm.queue.CheckOutTask;
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.scm.queue.CheckOutTask;
 
-import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 
 /**
@@ -37,7 +36,7 @@
      */
     private TaskQueue checkOutQueue;
 
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
         ContinuumProject project = getProject( context );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/BuildProjectsFromMetadataAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/BuildProjectsFromMetadataAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/BuildProjectsFromMetadataAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/BuildProjectsFromMetadataAction.java
Thu Jun  2 12:16:55 2005
@@ -22,7 +22,6 @@
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -42,7 +41,7 @@
      */
     private ContinuumProjectBuilderManager projectBuilderManager;
 
-    protected void doExecute( Map context )
+    public  void execute( Map context )
         throws Exception
     {
         String projectBuilderId = getString( context, KEY_PROJECT_BUILDER_ID );
@@ -54,10 +53,5 @@
         ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
url );
 
         context.put( KEY_PROJECT_BUILDING_RESULT, result );
-    }
-
-    protected void handleException( Throwable throwable )
-        throws ContinuumStoreException
-    {
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
Thu Jun  2 12:16:55 2005
@@ -21,8 +21,6 @@
 
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.apache.maven.scm.manager.NoSuchScmProviderException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -31,14 +29,14 @@
 public class CheckOutProjectContinuumAction
     extends AbstractContinuumAction
 {
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
-        String projectId = getProjectId();
+        String projectId = getProjectId( context );
 
         ContinuumProject project = getStore().getProject( projectId );
 
-        File workingDirectory = getWorkingDirectory();
+        File workingDirectory = getWorkingDirectory( context );
 
         CheckOutScmResult result;
 
@@ -46,27 +44,6 @@
 
         getStore().setCheckoutDone( projectId, result, null, null );
 
-        putContext( KEY_CHECKOUT_SCM_RESULT, result );
-    }
-
-    protected void handleException( Throwable throwable )
-        throws ContinuumStoreException
-    {
-        String errorMessage = null;
-
-        // TODO: Dissect the scm exception to be able to give better feedback
-        Throwable cause = throwable.getCause();
-
-        if ( cause instanceof NoSuchScmProviderException )
-        {
-            errorMessage = cause.getMessage();
-
-            throwable = null;
-        }
-
-        getStore().setCheckoutDone( getProjectId(),
-                                    getCheckOutResult(),
-                                    errorMessage,
-                                    throwable );
+        context.put( KEY_CHECKOUT_SCM_RESULT, result );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Thu Jun  2 12:16:55 2005
@@ -21,12 +21,10 @@
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
-import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.scm.UpdateScmResult;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -35,18 +33,18 @@
 public class ExecuteBuilderContinuumAction
     extends AbstractContinuumAction
 {
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
         // ----------------------------------------------------------------------
         // Get parameters from the context
         // ----------------------------------------------------------------------
 
-        ContinuumProject project = getProject();
+        ContinuumProject project = getProject( context );
 
-        boolean forced = isForced();
+        boolean forced = isForced( context );
 
-        UpdateScmResult updateScmResult = getUpdateScmResult();
+        UpdateScmResult updateScmResult = getUpdateScmResult( context );
 
         ContinuumBuildExecutor buildExecutor = getCore().getBuildExecutor( project.getExecutorId()
);
 
@@ -60,7 +58,7 @@
         {
             getLogger().info( "No files updated, not building. Project id '" + project.getId()
+ "'." );
 
-            getStore().setBuildNotExecuted( getProjectId() );
+            getStore().setBuildNotExecuted( getProjectId( context ) );
 
             return;
         }
@@ -69,15 +67,17 @@
         // Make the build result
         // ----------------------------------------------------------------------
 
-        String buildId = getStore().buildingProject( getProjectId(), forced, updateScmResult
);
+        String buildId = getStore().buildingProject( getProjectId( context ),
+                                                     forced,
+                                                     updateScmResult );
 
-        putContext( KEY_BUILD_ID, buildId );
+        context.put( KEY_BUILD_ID, buildId );
 
         // ----------------------------------------------------------------------
         //
         // ----------------------------------------------------------------------
 
-        getNotifier().runningGoals( project, getBuild() );
+        getNotifier().runningGoals( project, getBuild( context ) );
 
         ContinuumBuildResult result = buildExecutor.build( project );
 
@@ -89,14 +89,6 @@
                                    result,
                                    updateScmResult,
                                    null );
-    }
-
-    protected void handleException( Throwable throwable )
-        throws ContinuumStoreException
-    {
-        getStore().setBuildError( getBuildId(),
-                                  getUpdateScmResult( null ),
-                                  throwable );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
Thu Jun  2 12:16:55 2005
@@ -16,12 +16,12 @@
  * limitations under the License.
  */
 
-import java.util.Map;
 import java.io.File;
+import java.util.Map;
 
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.store.ContinuumStore;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -41,7 +41,7 @@
      */
     private String workingDirectory;
 
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
         ContinuumProject project = getProject( context );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
Thu Jun  2 12:16:55 2005
@@ -19,9 +19,7 @@
 import java.util.Map;
 
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.scm.UpdateScmResult;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -30,10 +28,10 @@
 public class UpdateProjectFromScmContinuumAction
     extends AbstractContinuumAction
 {
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
-        ContinuumProject project = getProject();
+        ContinuumProject project = getProject( context );
 
         String projectId = project.getId();
 
@@ -47,24 +45,8 @@
 
         UpdateScmResult updateScmResult = getScm().updateProject( project );
 
-        putContext( KEY_UPDATE_SCM_RESULT, updateScmResult );
+        context.put( KEY_UPDATE_SCM_RESULT, updateScmResult );
 
         getStore().setUpdateDone( projectId );
-    }
-
-    protected void handleException( Throwable throwable )
-        throws ContinuumStoreException
-    {
-        getLogger().fatalError( "Error while updating from SCM. Project id '" + getProjectId()
+ "'." );
-
-        getStore().setBuildError( getBuildId(),
-                                  getUpdateScmResult( null ),
-                                  throwable );
-    }
-
-    protected void doFinally()
-        throws ContinuumStoreException
-    {
-        getNotifier().checkoutComplete( getProject(), getUpdateScmResult() );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectMetadataContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectMetadataContinuumAction.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectMetadataContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectMetadataContinuumAction.java
Thu Jun  2 12:16:55 2005
@@ -18,9 +18,6 @@
 
 import java.util.Map;
 
-import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -28,17 +25,9 @@
 public class UpdateProjectMetadataContinuumAction
     extends AbstractContinuumAction
 {
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
-        getCore().updateProjectFromScm( getProjectId() );
-    }
-
-    protected void handleException( Throwable throwable )
-        throws ContinuumStoreException
-    {
-        getStore().setBuildError( getBuildId(),
-                                  getUpdateScmResult( null ),
-                                  throwable );
+        getCore().updateProjectFromScm( getProjectId( context ) );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=179629&r1=179628&r2=179629&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
Thu Jun  2 12:16:55 2005
@@ -22,7 +22,6 @@
 import org.apache.maven.continuum.core.ContinuumCore;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.store.ContinuumStore;
 
 import org.codehaus.plexus.util.StringUtils;
@@ -49,7 +48,7 @@
      */
     private ContinuumStore store;
 
-    protected void doExecute( Map context )
+    public void execute( Map context )
         throws Exception
     {
         ContinuumProject project = getProject( context );
@@ -79,10 +78,5 @@
         // ----------------------------------------------------------------------
 
         project.setCommandLineArguments( StringUtils.clean( project.getCommandLineArguments()
) );
-    }
-
-    protected void handleException( Throwable throwable )
-        throws ContinuumStoreException
-    {
     }
 }



Mime
View raw message