airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramin...@apache.org
Subject svn commit: r1536481 - /airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
Date Mon, 28 Oct 2013 18:44:42 GMT
Author: raminder
Date: Mon Oct 28 18:44:41 2013
New Revision: 1536481

URL: http://svn.apache.org/r1536481
Log:
code review and moved cleanup to finally block

Modified:
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java?rev=1536481&r1=1536480&r2=1536481&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
Mon Oct 28 18:44:41 2013
@@ -316,24 +316,23 @@ public class WorkflowInterpreter {
 			} catch (InterruptedException e) {
 				e.printStackTrace();
 			}
-			cleanup();
-			if (config.getNotifier() != null) {
-				this.config.getNotifier().cleanup();
-			}
 			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_END, new WorkflowInterpreterInteractor.TaskNotification("Stop
Workflow",
 					"Cleaning up resources for Workflow", uuid.toString()));
 
-			this.getWorkflow().setExecutionState(WorkflowExecutionState.NONE);
 		} catch (RuntimeException e) {
 			// we reset all the state
 			cleanup();
             this.config.getNotifier().workflowFailed(e.getMessage());
-            this.config.getNotifier().cleanup();
-			this.getWorkflow().setExecutionState(WorkflowExecutionState.NONE);
-			raiseException(e);
+        	raiseException(e);
 		} catch (AiravataAPIInvocationException e) {
             e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
-        }
+        }finally{
+        	cleanup();
+			if (config.getNotifier() != null) {
+				this.config.getNotifier().cleanup();
+			}
+			this.getWorkflow().setExecutionState(WorkflowExecutionState.NONE);
+	    }
     }
 
 	/**
@@ -556,9 +555,6 @@ public class WorkflowInterpreter {
 
 		}
 		this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new
String[outputKeywords.size()]));
-		cleanup();
-		this.config.getNotifier().cleanup();
-
 	}
 
 	private void executeDynamically(final Node node) throws WorkflowException {



Mime
View raw message