You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/10/24 17:25:09 UTC

svn commit: r1401728 - in /airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya: interpretor/WorkflowInterpreter.java interpretor/WorkflowInterpretorSkeleton.java invoker/MsgBoxWsaResponsesCorrelator.java

Author: lahiru
Date: Wed Oct 24 15:25:09 2012
New Revision: 1401728

URL: http://svn.apache.org/viewvc?rev=1401728&view=rev
Log:
fixng shutdown issue.

Modified:
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.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=1401728&r1=1401727&r2=1401728&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 Wed Oct 24 15:25:09 2012
@@ -110,6 +110,8 @@ import org.apache.airavata.xbaya.ui.moni
 import org.apache.airavata.xbaya.util.AmazonUtil;
 import org.apache.airavata.xbaya.util.InterpreterUtil;
 import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.xmlpull.infoset.XmlElement;
 
 import xsul.lead.LeadContextHeader;
@@ -117,6 +119,7 @@ import xsul.lead.LeadResourceMapping;
 import xsul5.XmlConstants;
 
 public class WorkflowInterpreter {
+    private static final Logger log = LoggerFactory.getLogger(WorkflowInterpreter.class);
 
 	public static final String WORKFLOW_STARTED = "Workflow Running";
 	public static final String WORKFLOW_FINISHED = "Workflow Finished";
@@ -202,6 +205,9 @@ public class WorkflowInterpreter {
 				}
 				// get task list and execute them
 				ArrayList<Node> readyNodes = this.getReadyNodesDynamically();
+                if(readyNodes.size() == 0){
+                    this.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
+                }
 				for (Node node : readyNodes) {
 					if (node.isBreak()) {
 						this.notifyPause();
@@ -245,7 +251,8 @@ public class WorkflowInterpreter {
 					try {
 						Thread.sleep(400);
 					} catch (InterruptedException e) {
-						e.printStackTrace();
+						log.error("Workflow Excecution is interrupted !");
+                        return;
 					}
 				}
 			}

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1401728&r1=1401727&r2=1401728&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java Wed Oct 24 15:25:09 2012
@@ -350,12 +350,12 @@ public class WorkflowInterpretorSkeleton
             /*
              * stop listener no matter what happens
              */
-//            try {
-//                if(listener != null)
-//                listener.stop();
-//            } catch (MonitorException e) {
-//                e.printStackTrace();
-//            }
+            try {
+                if(listener != null)
+                listener.stop();
+            } catch (MonitorException e) {
+                e.printStackTrace();
+            }
         }
     }
 
@@ -398,6 +398,7 @@ public class WorkflowInterpretorSkeleton
         if (runner != null) {
             runner.shutDown();
         }
+
         notInterrupted = false;
     }
 

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java?rev=1401728&r1=1401727&r2=1401728&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java (original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java Wed Oct 24 15:25:09 2012
@@ -112,13 +112,21 @@ public class MsgBoxWsaResponsesCorrelato
                 }
                 try {
                     Thread.currentThread().sleep(1000L); //do not overload msg box service ...
-                } catch (InterruptedException e) {}
+                } catch (InterruptedException e) {
+                    break;
+                }
             } catch (XsulException e) {
-                logger.info("could not retrieve messages", e);
+                logger.error("could not retrieve messages");
+                break;
             } catch (RemoteException e) {
-                logger.info("could not retrieve messages", e);
+                logger.error("could not retrieve messages");
+                break;
             } catch (XMLStreamException e) {
-                logger.info("could not retrieve messages", e);
+                logger.error("could not retrieve messages");
+                break;
+            } catch (Exception e){
+                logger.error("could not retrieve messages");
+                break;
             }
         }
     }