airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1386797 - in /incubator/airavata/trunk/modules: gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/ ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/ ws-messenger/messagebroker/src/main/java/org/apache/ai...
Date Mon, 17 Sep 2012 20:05:13 GMT
Author: lahiru
Date: Mon Sep 17 20:05:12 2012
New Revision: 1386797

URL: http://svn.apache.org/viewvc?rev=1386797&view=rev
Log:
fixing shutdown issues.

Modified:
    incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
    incubator/airavata/trunk/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
    incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java

Modified: incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java?rev=1386797&r1=1386796&r2=1386797&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
(original)
+++ incubator/airavata/trunk/modules/gfac-axis2/src/main/java/org/apache/airavata/services/gfac/axis2/GFacService.java
Mon Sep 17 20:05:12 2012
@@ -180,23 +180,28 @@ public class GFacService implements Serv
             this.context = context;
         }
 
-        public void run() {
-            try {
+         public void run() {
+            try{
                 while (true) {
                     try {
-						AiravataRegistry2 registry = ((GFacConfiguration)context.getProperty(GFAC_CONFIGURATION)).getRegistry();
-						String localAddress = (String) this.context.getProperty(GFAC_URL);
-                        registry.addGFacURI(new URI(localAddress));
-						log.info("Updated the GFac URL in to Repository");
-						Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
-                    }catch (URISyntaxException e) {
-                        Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
-                        e.printStackTrace();  //To change body of catch statement use File
| Settings | File Templates.
+                        AiravataRegistry2 registry = ((GFacConfiguration)context.getProperty(GFAC_CONFIGURATION)).getRegistry();
+                        URI localAddress = new URI((String)this.context.getProperty(GFAC_URL));
+                        registry.addGFacURI(localAddress);
+                        log.info("Updated Workflow Interpreter service URL in to Repository");
+                        Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
+                    } catch (InterruptedException e) {
+                        break;
                     }
                 }
-            } catch (InterruptedException e) {
-                log.info("GFacURL update thread is interrupted");
-			}
+            }catch (Exception e){
+                try {
+                    Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
+                    return;
+                }
+                log.error("Workflow Interpreter Service URL update thread is interrupted");
+            }
         }
     }
 }

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java?rev=1386797&r1=1386796&r2=1386797&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
Mon Sep 17 20:05:12 2012
@@ -171,22 +171,28 @@ public class MsgBoxServiceLifeCycle impl
             this.context = context;
         }
 
+
         public void run() {
-            try {
+            try{
                 while (true) {
-                    AiravataRegistry2 registry = (AiravataRegistry2) context.getProperty(JCR_REGISTRY);
-                    URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-                    registry.setMessageBoxURI(localAddress);
-                    logger.info("Updated the Message box URL in to Repository");
-                    Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
+                    try {
+                        AiravataRegistry2 registry = (AiravataRegistry2) context.getProperty(JCR_REGISTRY);
+                        URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
+                        registry.setMessageBoxURI(localAddress);
+                        logger.info("Updated Workflow Interpreter service URL in to Repository");
+                        Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
+                    } catch (InterruptedException e) {
+                        break;
+                    }
                 }
-            } catch (InterruptedException e) {
+            }catch (Exception e){
                 try {
                     Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
                 } catch (InterruptedException e1) {
                     e1.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
+                    return;
                 }
-                logger.info("Message box url update thread is interrupted");
+                logger.error("Workflow Interpreter Service URL update thread is interrupted");
             }
         }
     }

Modified: incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java?rev=1386797&r1=1386796&r2=1386797&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
(original)
+++ incubator/airavata/trunk/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
Mon Sep 17 20:05:12 2012
@@ -311,21 +311,26 @@ public class BrokerServiceLifeCycle impl
         public void run() {
             try {
                 while (true) {
-                    AiravataRegistry2 registry = (AiravataRegistry2) context.getProperty(JCR_REGISTRY);
-                    URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-                    registry.setEventingURI(localAddress);
-                    log.info("Updated the Eventing service URL in to Repository");
-                    Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
-
+                    try {
+                        AiravataRegistry2 registry = (AiravataRegistry2) context.getProperty(JCR_REGISTRY);
+                        URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
+                        registry.setEventingURI(localAddress);
+                        log.info("Updated Workflow Interpreter service URL in to Repository");
+                        Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
+                    } catch (InterruptedException e) {
+                        break;
+                    }
                 }
-            } catch (InterruptedException e) {
+            } catch (Exception e) {
                 try {
                     Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
                 } catch (InterruptedException e1) {
                     e1.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
+                    return;
                 }
-                log.info("Eventing service url update thread is interrupted");
+                log.error("Workflow Interpreter Service URL update thread is interrupted");
             }
         }
+
     }
 }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1386797&r1=1386796&r2=1386797&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
Mon Sep 17 20:05:12 2012
@@ -106,6 +106,7 @@ public class WorkflowInterpretorSkeleton
     public static  ConfigurationContext configurationContext;
     public static final String OUTPUT_DATA_PATH = "outputDataPath";
     public static final String SERVICE_NAME="WorkflowInterpretor";
+    public static boolean notInterrupted = true;
 
 	protected static final String SERVICE_URL = "interpreter_service_url";
 
@@ -387,6 +388,7 @@ public class WorkflowInterpretorSkeleton
          if (runner != null) {
              runner.shutDown();
          }
+         notInterrupted = false;
     }
 
     private List<HostDescription> getDefinedHostDescriptions() {
@@ -430,23 +432,27 @@ public class WorkflowInterpretorSkeleton
         }
 
         public void run() {
-            try {
+            try{
                 while (true) {
                     try {
-						AiravataRegistry2 registry = (AiravataRegistry2 )context.getProperty(JCR_REG);
-						URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-						registry.addWorkflowInterpreterURI(localAddress);
-						log.info("Updated Workflow Interpreter service URL in to Repository");
-						Thread.sleep(URL_UPDATE_INTERVAL);
-					} catch (Exception e) {
-						//in case of an registry exception best to retry sooner
-						log.severe("Error saving GFac descriptor",e);
-						Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
-					}
+                        AiravataRegistry2 registry = (AiravataRegistry2) context.getProperty(JCR_REG);
+                        URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
+                        registry.addWorkflowInterpreterURI(localAddress);
+                        log.info("Updated Workflow Interpreter service URL in to Repository");
+                        Thread.sleep(URL_UPDATE_INTERVAL);
+                    } catch (InterruptedException e) {
+                        break;
+                    }
+                }
+            }catch (Exception e){
+                try {
+                    Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
+                    return;
                 }
-            } catch (InterruptedException e) {
                 log.severe("Workflow Interpreter Service URL update thread is interrupted");
-			}
+            }
         }
     }
 }



Mime
View raw message