Repository: airavata
Updated Branches:
  refs/heads/master 7e022eff0 -> 719142d28


removing threading in launchExperiment


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

Branch: refs/heads/master
Commit: 719142d284f22f295b7fe36e438eb6bacb32bbc2
Parents: 7e022ef
Author: lahiru <[email protected]>
Authored: Fri May 23 15:48:52 2014 -0400
Committer: lahiru <[email protected]>
Committed: Fri May 23 15:48:52 2014 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/719142d2/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 0dd33af..2eb73d7 100644
--- 
a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ 
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -826,18 +826,20 @@ public class AiravataServerHandler implements 
Airavata.Iface {
     public void launchExperiment(String airavataExperimentId, String 
airavataCredStoreToken) throws InvalidRequestException, 
ExperimentNotFoundException, AiravataClientException, AiravataSystemException, 
LaunchValidationException, TException {
         final OrchestratorService.Client orchestratorClient = 
getOrchestratorClient();
         final String expID = airavataExperimentId;
-        if (orchestratorClient.validateExperiment(expID)) {
-            (new Thread() {
-                public void run() {
-                    try {
-                        orchestratorClient.launchExperiment(expID);
-                    } catch (TException e) {
-                        e.printStackTrace();  //To change body of catch 
statement use File | Settings | File Templates.
-                    }
-                }
-            }).start();
-        } else {
-            throw new InvalidRequestException("Experiment Validation Failed, 
please check the configuration");
+        synchronized (this) {
+            if (orchestratorClient.validateExperiment(expID)) {
+//                (new Thread() {
+//                    public void run() {
+                        try {
+                            orchestratorClient.launchExperiment(expID);
+                        } catch (TException e) {
+                            e.printStackTrace();  //To change body of catch 
statement use File | Settings | File Templates.
+                        }
+//                    }
+//                }).start();
+            } else {
+                throw new InvalidRequestException("Experiment Validation 
Failed, please check the configuration");
+            }
         }
     }
 

Reply via email to