airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1526311 - /airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
Date Wed, 25 Sep 2013 21:43:20 GMT
Author: chathuri
Date: Wed Sep 25 21:43:20 2013
New Revision: 1526311

URL: http://svn.apache.org/r1526311
Log:
fixing AIRAVATA-920

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

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java?rev=1526311&r1=1526310&r2=1526311&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
Wed Sep 25 21:43:20 2013
@@ -24,8 +24,10 @@ package org.apache.airavata.xbaya;
 import java.net.URI;
 import java.util.List;
 
+import org.apache.airavata.client.AiravataAPIFactory;
 import org.apache.airavata.client.api.AiravataAPI;
 import org.apache.airavata.client.api.AiravataManager;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
 import org.apache.airavata.workflow.model.component.ComponentRegistryException;
 import org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry;
 import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
@@ -36,6 +38,7 @@ import org.apache.airavata.ws.monitor.Mo
 import org.apache.airavata.ws.monitor.MonitorConfiguration;
 import org.apache.airavata.xbaya.component.registry.ComponentController;
 import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.registry.PasswordCallbackImpl;
 import org.apache.airavata.xbaya.ui.XBayaGUI;
 import org.apache.airavata.xbaya.ui.monitor.MonitorStarter;
 import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
@@ -84,6 +87,18 @@ public class XBayaEngine {
                 configuration.getTopic(), configuration.isPullMode(), configuration.getMessageBoxURL());
         this.monitor = new Monitor(monitorConfiguration);
 
+        if (configuration.getAiravataAPI() == null && airavataAPI == null) {
+            try {
+                airavataAPI =  AiravataAPIFactory.getAPI(configuration.getRegistryURL(),
+                        configuration.getDefaultGateway(), configuration.getRegistryUserName(),
+                        new PasswordCallbackImpl(configuration.getRegistryUserName(), configuration.getRegistryPassphrase()));
+                configuration.setAiravataAPI(airavataAPI);
+            } catch (AiravataAPIInvocationException e) {
+                logger.error("Unable to instantiate airavata api instance", e);
+            }
+
+        }
+
         // MyProxy
         // this.myProxyClient = new MyProxyClient(this.configuration.getMyProxyServer(),
         // this.configuration.getMyProxyPort(), this.configuration.getMyProxyUsername(),
@@ -239,8 +254,8 @@ public class XBayaEngine {
 	
 	public void updateXBayaConfigurationServiceURLs() {
 		try {
-			if (this.getConfiguration().getAiravataAPI()!=null && this.getConfiguration().getAiravataAPI()!=null){
-                AiravataAPI airavataAPI = getConfiguration().getAiravataAPI();
+			if (this.getConfiguration().getAiravataAPI()!=null){
+                airavataAPI = getConfiguration().getAiravataAPI();
                 AiravataManager airavataManager = airavataAPI.getAiravataManager();
 //                AiravataRegistry2 registry=this.getConfiguration().getJcrComponentRegistry().getRegistry();
 	        	URI eventingServiceURL = airavataManager.getEventingServiceURL();



Mime
View raw message