airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject [11/51] [abbrv] git commit: fixnig minor issue related to status updators
Date Wed, 21 May 2014 17:56:25 GMT
fixnig minor issue related to status updators


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/0da59822
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/0da59822
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/0da59822

Branch: refs/heads/temp
Commit: 0da59822c2a2736c045e1b16493d20fde54d19ad
Parents: b203064
Author: lahiru <lahiru@apache.org>
Authored: Thu May 1 17:40:10 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Thu May 1 17:40:10 2014 -0400

----------------------------------------------------------------------
 .../gfac-gsissh/src/test/resources/gfac-config.xml  |  2 +-
 .../gfac/monitor/AiravataJobStatusUpdator.java      |  1 +
 .../monitor/handlers/GridPullMonitorHandler.java    | 16 ++++++++++++++--
 .../airavata/gfac/monitor/util/CommonUtils.java     |  3 +--
 4 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/0da59822/modules/gfac/gfac-gsissh/src/test/resources/gfac-config.xml
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-gsissh/src/test/resources/gfac-config.xml b/modules/gfac/gfac-gsissh/src/test/resources/gfac-config.xml
index 00ffbce..759af93 100644
--- a/modules/gfac/gfac-gsissh/src/test/resources/gfac-config.xml
+++ b/modules/gfac/gfac-gsissh/src/test/resources/gfac-config.xml
@@ -21,7 +21,7 @@
     </GlobalHandlers>
 
 
-     <Provider class="org.apache.airavata.gfac.provider.impl.GSISSHProvider" host="org.apache.airavata.schemas.gfac.impl.GsisshHostTypeImpl">
+     <Provider class="org.apache.airavata.gfac.provider.impl.GSISSHProvider" host="org.apache.airavata.schemas.gfac.impl.GsisshHostTypeImpl"
executionMode="async">
          <InHandlers>
             <Handler class="org.apache.airavata.gfac.handler.GSISSHDirectorySetupHandler"/>
             <Handler class="org.apache.airavata.gfac.handler.GSISSHInputHandler"/>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0da59822/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
index 99c8733..6db5241 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/AiravataJobStatusUpdator.java
@@ -45,6 +45,7 @@ public class AiravataJobStatusUpdator implements AbstractActivityListener
{
 
     private BlockingQueue<MonitorID> jobsToMonitor;
 
+
     public Registry getAiravataRegistry() {
         return airavataRegistry;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/0da59822/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
index 452f536..fc83751 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/handlers/GridPullMonitorHandler.java
@@ -35,6 +35,8 @@ import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -50,7 +52,11 @@ public class GridPullMonitorHandler extends ThreadedHandler {
 
     private AuthenticationInfo authenticationInfo;
 
+    private List<AbstractActivityListener> activityListeners;
+
+    boolean registrySet = false;
     public void initProperties(Map<String, String> properties) throws GFacHandlerException
{
+        activityListeners = new ArrayList<AbstractActivityListener>();
         String myProxyUser = null;
         try {
             myProxyUser = ServerSettings.getSetting("myproxy.username");
@@ -62,10 +68,11 @@ public class GridPullMonitorHandler extends ThreadedHandler {
             hpcPullMonitor = new HPCPullMonitor();
             String listeners = properties.get("listeners");
             String[] split = listeners.split(",");
-            for(String listenerClass:split) {
+            for (String listenerClass : split) {
                 Class<? extends AbstractActivityListener> aClass = Class.forName(listenerClass).asSubclass(AbstractActivityListener.class);
                 AbstractActivityListener abstractActivityListener = aClass.newInstance();
-                abstractActivityListener.setup(hpcPullMonitor.getQueue(),hpcPullMonitor.getPublisher());
+                activityListeners.add(abstractActivityListener);
+                abstractActivityListener.setup(hpcPullMonitor.getQueue(), hpcPullMonitor.getPublisher());
                 hpcPullMonitor.getPublisher().registerListener(abstractActivityListener);
             }
         } catch (ApplicationSettingsException e) {
@@ -84,6 +91,11 @@ public class GridPullMonitorHandler extends ThreadedHandler {
     }
 
     public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException{
+        if(!registrySet){
+            for(AbstractActivityListener listener:activityListeners){
+                listener.setup(jobExecutionContext.getRegistry());
+            }
+        }
         super.invoke(jobExecutionContext);
         MonitorID monitorID = new MonitorID(authenticationInfo, jobExecutionContext);
         try {

http://git-wip-us.apache.org/repos/asf/airavata/blob/0da59822/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
index 2071c5d..17d7925 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/util/CommonUtils.java
@@ -176,8 +176,7 @@ public class CommonUtils {
     }
 
     public static void invokeOutFlowHandlers(JobExecutionContext jobExecutionContext) throws
GFacException {
-        GFacConfiguration gFacConfiguration = jobExecutionContext.getGFacConfiguration();
-        List<GFacHandlerConfig> handlers = null;
+        List<GFacHandlerConfig> handlers = jobExecutionContext.getGFacConfiguration().getOutHandlers();
 
         for (GFacHandlerConfig handlerClassName : handlers) {
             Class<? extends GFacHandler> handlerClass;


Mime
View raw message