airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [3/4] git commit: Set default faules to dialogs and remove unused code parts, used id instead of experimentId to stopListen call
Date Fri, 17 Oct 2014 16:13:24 GMT
Set default faules to dialogs and remove unused code parts, used id instead of experimentId
to stopListen call


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

Branch: refs/heads/master
Commit: d4bf1e9cd73650e4c37857625f9191311f5223ee
Parents: 7c2af98
Author: shamrath <shameerainfo@gmail.com>
Authored: Fri Oct 17 12:10:36 2014 -0400
Committer: shamrath <shameerainfo@gmail.com>
Committed: Fri Oct 17 12:10:36 2014 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/xbaya/XBayaEngine.java  |  22 +---
 .../registry/ComponentRegistryLoader.java       |   4 +-
 .../airavata/xbaya/messaging/Monitor.java       |   5 +-
 .../ui/dialogs/registry/RegistryWindow.java     |   5 +
 .../WorkflowInterpreterLaunchWindow.java        | 129 +------------------
 5 files changed, 15 insertions(+), 150 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d4bf1e9c/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
index 33a27b0..a6b0beb 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
@@ -35,7 +35,6 @@ import org.apache.airavata.xbaya.ui.monitor.MonitorStarter;
 import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
 import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector;
 import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
-import org.apache.airavata.xbaya.workflow.WorkflowClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 //import org.apache.airavata.registry.api.AiravataRegistry2;
@@ -48,13 +47,8 @@ public class XBayaEngine {
 
     private XBayaGUI gui;
 
-    private WorkflowClient workflowClient;
-
-    //FIXME: use rabbit mq producer instead of WS-Messanger producer
     private Monitor monitor;
 
-
-
     private boolean exitOnClose = true;
 
     private ComponentTreeNode systemComponentTree;
@@ -105,16 +99,6 @@ public class XBayaEngine {
     }
 
     /**
-     * Returns the Workflow Client.
-     *
-     * @return the Workflow Client
-     */
-    public WorkflowClient getWorkflowClient() {
-        return this.workflowClient;
-    }
-
-
-    /**
      * Returns the monitor.
      *
      * @return The monitor
@@ -190,10 +174,8 @@ public class XBayaEngine {
      */
     private void initMonitor() {
         try {
-            if (this.configuration.isStartMonitor()) {
-                MonitorStarter starter = new MonitorStarter(this);
-                starter.start();
-            }
+            MonitorStarter starter = new MonitorStarter(this);
+            starter.start();
         } catch (RuntimeException e) {
             getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
         } catch (Error e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4bf1e9c/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
index 2c0493c..b367dd6 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
@@ -122,23 +122,21 @@ public class ComponentRegistryLoader implements Cancelable, Observer
{
             }
             this.getEngine().getGUI().getComponentSelector().addComponentTree(componentTree);
 //            getComponentTreeNodesMap().put(registry.getName(),componentTree);
-            this.loadingDialog.hide();
         } catch (ComponentRegistryException e) {
             if (this.canceled) {
                 logger.error(e.getMessage(), e);
             } else {
                 this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR,
e);
-                this.loadingDialog.hide();
             }
         } catch (RuntimeException e) {
             if (this.canceled) {
                 logger.error(e.getMessage(), e);
             } else {
                 this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR,
e);
-                this.loadingDialog.hide();
             }
         } catch (Error e) {
             this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
e);
+        }finally {
             this.loadingDialog.hide();
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4bf1e9c/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/messaging/Monitor.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/messaging/Monitor.java
b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/messaging/Monitor.java
index 339df30..87ce29c 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/messaging/Monitor.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/messaging/Monitor.java
@@ -107,7 +107,6 @@ public class Monitor extends EventProducer {
             logger.error(msg, e);
             throw new MonitorException(msg, e);
         }
-        setMonitoring(true);
         // Enable/disable some menu items and show the monitor panel.
         sendSafeEvent(new Event(Event.Type.MONITOR_STARTED));
         getEventDataRepository().triggerListenerForPostMonitorStart();
@@ -220,11 +219,13 @@ public class Monitor extends EventProducer {
      */
     public void subscribe(String experimentID) throws MonitorException {
         try {
+            setMonitoring(true);
             String id = messageClient.listen(new NotificationMessageHandler(experimentID));
             expIdToSubscribers.put(experimentID, id);
         } catch (AiravataException e) {
             String msg = "Failed to listen to experiment: " + experimentID;
             logger.error(msg);
+            setMonitoring(false);
             throw new MonitorException(msg, e);
         }
     }
@@ -239,7 +240,7 @@ public class Monitor extends EventProducer {
         String id = expIdToSubscribers.remove(experimentId);
         if (id != null) {
             try {
-                messageClient.stopListen(experimentId);
+                messageClient.stopListen(id);
             } catch (AiravataException e) {
                 logger.warn("Failed to find the subscriber for experiment id: " + id, e);
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4bf1e9c/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
index 8bcc2bc..20cde47 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
@@ -124,6 +124,11 @@ public class RegistryWindow {
         this.usernameTextField = new XBayaTextField();
         this.serverTextField.setText("localhost");
         this.portTextField.setText("8930");
+        if (serviceType == ThriftServiceType.WORKFLOW_SERVICE){
+            this.portTextField.setText("8931");
+        }
+        this.gatewayNameTextField.setText("airavata");
+        this.usernameTextField.setText("airavata");
         ThriftClientData thriftClientData = engine.getConfiguration().getThriftClientData(ThriftServiceType.WORKFLOW_SERVICE);
     	if (thriftClientData!=null){
     		this.serverTextField.setText(thriftClientData.getServerAddress());

http://git-wip-us.apache.org/repos/asf/airavata/blob/d4bf1e9c/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
index 8605499..fd88275 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
@@ -83,23 +83,14 @@ public class WorkflowInterpreterLaunchWindow {
 
     private GridPanel parameterPanel;
 
-//    private XBayaTextField topicTextField;
-
     private List<XBayaTextField> parameterTextFields = new ArrayList<XBayaTextField>();
 
-//    private XBayaTextField workflowInterpreterTextField;
-
-//    private XBayaTextField RegistryTextField;
-
-//    private XBayaTextField gfacTextField;
-
 	private XBayaTextField instanceNameTextField;
 
     private Airavata.Client airavataClient;
 
     private JComboBox host;
     private HashMap<String, String> hostNames;
-    //    protected final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
 
     /**
      * Constructs a WorkflowInterpreterLaunchWindow.
@@ -110,9 +101,7 @@ public class WorkflowInterpreterLaunchWindow {
     public WorkflowInterpreterLaunchWindow(XBayaEngine engine) throws AiravataClientConnectException
{
         this.engine = engine;
         airavataClient = AiravataClientFactory.createAiravataClient("127.0.0.1", 8930);
-//        if (XBayaUtil.acquireJCRRegistry(engine)) {
             initGUI();
-//        }
     }
 
     /**
@@ -121,12 +110,6 @@ public class WorkflowInterpreterLaunchWindow {
     public void show() {
         this.workflow = this.engine.getGUI().getWorkflow();
 
-//        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
-//        if (notifConfig.getBrokerURL() == null) {
-//            this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
-//            return;
-//        }
-
         // Create input fields
         Collection<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
         for (InputNode node : inputNodes) {
@@ -199,25 +182,6 @@ public class WorkflowInterpreterLaunchWindow {
         this.parameterPanel.add(hostLabel);
         this.parameterPanel.add(host);
         this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);
-//        this.instanceNameTextField.setText(workflow.getName()+"_"+Calendar.getInstance().getTime().toString());
-//        this.topicTextField.setText(UUID.randomUUID().toString());
-
-//        XBayaConfiguration config = this.engine.getConfiguration();
-//        this.gfacTextField.setText(config.getGFacURL().toString());
-//        URI workflowInterpreterURL = config.getWorkflowInterpreterURL();
-//        if (null != workflowInterpreterURL) {
-//            this.workflowInterpreterTextField.setText(workflowInterpreterURL.toString());
-//        } else {
-//            this.workflowInterpreterTextField.setText(XBayaConstants.DEFAULT_WORKFLOW_INTERPRETER_URL);
-//        }
-
-//        AiravataAPI airavataAPI = config.getAiravataAPI();
-//        if (null != airavataAPI) {
-//            this.RegistryTextField.setText(config.getRegistryURL());
-//        } else {
-//            this.RegistryTextField.setText(XBayaConstants.REGISTRY_URL.toASCIIString());
-//        }
-
         this.dialog.show();
     }
 
@@ -236,29 +200,10 @@ public class WorkflowInterpreterLaunchWindow {
 
         this.instanceNameTextField = new XBayaTextField();
         XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
-        
-//        this.topicTextField = new XBayaTextField();
-//        XBayaLabel topicLabel = new XBayaLabel("Notification topic", this.topicTextField);
-//        this.workflowInterpreterTextField = new XBayaTextField();
-//        XBayaLabel workflowInterpreterLabel = new XBayaLabel("Workflow Interpreter URL",
-//                this.workflowInterpreterTextField);
-//        this.RegistryTextField = new XBayaTextField();
-//        XBayaLabel RegistryLabel = new XBayaLabel("Registry URL", this.RegistryTextField);
-//        this.gfacTextField = new XBayaTextField();
-//        XBayaLabel gfacLabel = new XBayaLabel("GFac URL", this.gfacTextField);
 
         GridPanel infoPanel = new GridPanel();
         infoPanel.add(instanceNameLabel);
         infoPanel.add(this.instanceNameTextField);
-//        infoPanel.add(topicLabel);
-//        infoPanel.add(this.topicTextField);
-//        infoPanel.add(workflowInterpreterLabel);
-//        infoPanel.add(this.workflowInterpreterTextField);
-//        infoPanel.add(gfacLabel);
-//        infoPanel.add(this.gfacTextField);
-//        infoPanel.add(RegistryLabel);
-//        infoPanel.add(this.RegistryTextField);
-
         infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
 
         GridPanel mainPanel = new GridPanel();
@@ -306,17 +251,17 @@ public class WorkflowInterpreterLaunchWindow {
     }
 
     private void execute() throws AiravataClientConnectException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
-    	
+
     	if (!(engine.getGUI().setupThriftClientData(ThriftServiceType.API_SERVICE) &&
engine.getGUI().setupThriftClientData(ThriftServiceType.WORKFLOW_SERVICE))){
     		hide();
     		return;
     	}
-    	
+
     	ThriftClientData thriftClientData = engine.getConfiguration().getThriftClientData(ThriftServiceType.API_SERVICE);
 		Client airavataClient = XBayaUtil.getAiravataClient(thriftClientData);
-    	
+
 		org.apache.airavata.api.workflow.Workflow.Client workflowClient = XBayaUtil.getWorkflowClient(engine.getConfiguration().getThriftClientData(ThriftServiceType.WORKFLOW_SERVICE));
-		
+
 		Workflow workflowClone = workflow.clone();
 		workflowClone.setName(workflowClone.getName()+UUID.randomUUID().toString());
 		org.apache.airavata.model.Workflow w = new org.apache.airavata.model.Workflow();
@@ -345,8 +290,6 @@ public class WorkflowInterpreterLaunchWindow {
         project.setOwner(thriftClientData.getUsername());
         project.setProjectID(airavataClient.createProject(project));
         final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
-//        builder.newFragment("inputs");
-//        new ODEClient();
         final Experiment experiment = new Experiment();
         experiment.setApplicationId(w.getTemplateId());
         experiment.setName(instanceName);
@@ -406,70 +349,6 @@ public class WorkflowInterpreterLaunchWindow {
         }
         airavataClient.launchExperiment(experiment.getExperimentID(), "testToken");
 
-//        final String workflowInterpreterUrl = this.workflowInterpreterTextField.getText();
-//        if (null != workflowInterpreterUrl && !"".equals(workflowInterpreterUrl))
{
-//            try {
-//                this.engine.getConfiguration().setWorkflowInterpreterURL(new URI(workflowInterpreterUrl));
-//            } catch (URISyntaxException e) {
-//                this.engine.getGUI().getErrorWindow().error(e);
-//            }
-//        }
-
-//        final String gFacUrl = this.gfacTextField.getText();
-//        if (null != gFacUrl && !"".equals(gFacUrl)) {
-//            try {
-//                this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
-//            } catch (URISyntaxException e) {
-//                this.engine.getGUI().getErrorWindow().error(e);
-//            }
-//        }
-//        this.engine.getConfiguration().setTopic(topic);
-
-        new Thread() {
-            @Override
-            public void run() {
-//            	WorkflowInterpreter workflowInterpreter = new WorkflowInterpreter(experiment,
null, new WorkflowInterpreterConfiguration(workflow),getOrchestratorClient());
-//                try {
-//        			workflowInterpreter.scheduleDynamically();
-//        		} catch (WorkflowException e) {
-//        			e.printStackTrace();
-//        		} catch (RegistryException e) {
-//        			// TODO Auto-generated catch block
-//        			e.printStackTrace();
-//        		}
-//                try {
-//                    List<WorkflowInput> workflowInputs=new ArrayList<WorkflowInput>();
-//                    for (int i = 0; i < inputNodes.size(); i++) {
-//                    	InputNode inputNode = inputNodes.get(i);
-//                    	workflowInputs.add(new WorkflowInput(inputNode.getID(), inputNode.getDefaultValue().toString()));
-//                    }
-//                    AiravataAPI api = engine.getConfiguration().getAiravataAPI();
-//                    
-//                    ExperimentAdvanceOptions options = api.getExecutionManager().createExperimentAdvanceOptions(instanceNameFinal,
api.getCurrentUser(), null);
-//                    if (AmazonCredential.getInstance().getAwsAccessKeyId() != null) {
-//                        options.getCustomSecuritySettings().getAmazonWSSettings().setAccessKeyId(AmazonCredential.getInstance().getAwsAccessKeyId());
-//                        options.getCustomSecuritySettings().getAmazonWSSettings().setSecretAccessKey(AmazonCredential.getInstance().getAwsSecretAccessKey());
-//                    }
-//
-//                    //TODO get the token id from UI
-//                    // For the moment hard code it
-//                    // TODO Build UI to get the token id
-//                    //options.getCustomSecuritySettings().getCredentialStoreSecuritySettings().setTokenId("1234");
-//
-//
-//                    String experimentId = api.getExecutionManager().runExperiment(api.getWorkflowManager().getWorkflowAsString(workflow),
workflowInputs,options);
-//                    try {
-//                        WorkflowInterpreterLaunchWindow.this.engine.getMonitor().getConfiguration().setTopic(experimentId);
-//                        WorkflowInterpreterLaunchWindow.this.engine.getMonitor().start();
-//                    } catch (MonitorException e1) {
-//                        WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e1);
-//                    }
-//                } catch (Exception e) {
-//                    WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e);
-//                }
-            }
-        }.start();
-
         hide();
     }
     


Mime
View raw message