continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r755119 - /continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java
Date Tue, 17 Mar 2009 05:19:49 GMT
Author: ctan
Date: Tue Mar 17 05:19:48 2009
New Revision: 755119

URL: http://svn.apache.org/viewvc?rev=755119&view=rev
Log:
[CONTINUUM-1887] update listener when release rollback failed so that it won't hang


Modified:
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java?rev=755119&r1=755118&r2=755119&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/RollbackReleaseTaskExecutor.java
Tue Mar 17 05:19:48 2009
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.release.tasks.ReleaseProjectTask;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.ReleaseFailureException;
+import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
 import java.util.ArrayList;
@@ -33,6 +34,8 @@
 public class RollbackReleaseTaskExecutor
     extends AbstractReleaseTaskExecutor
 {
+    private static final int ERROR = 99;
+
     protected void execute( ReleaseProjectTask releaseTask )
         throws TaskExecutionException
     {
@@ -43,11 +46,18 @@
         }
         catch ( ReleaseExecutionException e )
         {
+            updateListener( releaseTask.getListener(), e.getMessage(), ERROR );
             throw new TaskExecutionException( "Failed to rollback release", e );
         }
         catch ( ReleaseFailureException e )
         {
+            updateListener( releaseTask.getListener(), e.getMessage(), ERROR );
             throw new TaskExecutionException( "Failed to rollback release", e );
         }
     }
+
+    private void updateListener( ReleaseManagerListener listener, String name, int state
)
+    {
+        listener.error( name );
+    }
 }



Mime
View raw message