You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2015/05/13 03:19:35 UTC
[3/3] airavata git commit: Cleaning up Xbaya use of legacy LEAD code
- AIRAVATA-1700
Cleaning up Xbaya use of legacy LEAD code - AIRAVATA-1700
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/382b6c0e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/382b6c0e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/382b6c0e
Branch: refs/heads/master
Commit: 382b6c0e6bf64d968bf0f39f3c5776dbc73c51d8
Parents: 34cd927
Author: Suresh Marru <sm...@apache.org>
Authored: Tue May 12 21:19:28 2015 -0400
Committer: Suresh Marru <sm...@apache.org>
Committed: Tue May 12 21:19:28 2015 -0400
----------------------------------------------------------------------
modules/workflow-model/workflow-engine/pom.xml | 7 -
modules/xbaya-gui/pom.xml | 5 -
.../airavata/xbaya/XBayaConfiguration.java | 12 -
.../org/apache/airavata/xbaya/XBayaVersion.java | 2 +-
.../xbaya/graph/controller/NodeController.java | 4 -
.../xbaya/interpretor/DoWhileHandler.java | 248 -------
.../interpretor/SystemComponentInvoker.java | 116 ----
.../xbaya/invoker/AsynchronousInvoker.java | 118 ----
.../airavata/xbaya/invoker/DynamicInvoker.java | 168 -----
.../xbaya/invoker/DynamicServiceCreator.java | 86 ---
.../xbaya/invoker/EmbeddedGFacInvoker.java | 686 -------------------
.../airavata/xbaya/invoker/GFacInvoker.java | 199 ------
.../airavata/xbaya/invoker/GenericInvoker.java | 529 --------------
.../apache/airavata/xbaya/invoker/Invoker.java | 105 ---
.../invoker/MsgBoxWsaResponsesCorrelator.java | 139 ----
.../airavata/xbaya/invoker/SimpleInvoker.java | 260 -------
.../xbaya/invoker/WorkflowInputUtil.java | 72 --
.../WorkflowInvokerWrapperForGFacInvoker.java | 233 -------
.../xbaya/invoker/factory/InvokerFactory.java | 90 ---
.../xbaya/jython/script/JythonScript.java | 7 +-
.../apache/airavata/xbaya/lead/LEADTypes.java | 225 ------
.../xbaya/lead/LeadContextHeaderHelper.java | 149 ----
.../xbaya/lead/NotificationHandler.java | 183 -----
.../graph/dynamic/DynamicNodeWindow.java | 475 -------------
.../dynamic/DynamicWorkflowRunnerWindow.java | 394 -----------
.../system/ConstantConfigurationDialog.java | 1 -
.../DifferedInputConfigurationDialog.java | 1 -
.../graph/system/InputConfigurationDialog.java | 1 -
.../xbaya/ui/graph/dynamic/DynamicNodeGUI.java | 73 --
.../airavata/xbaya/ui/menues/RunMenuItem.java | 6 +-
.../airavata/xbaya/util/InterpreterUtil.java | 391 -----------
.../apache/airavata/xbaya/util/XBayaUtil.java | 107 ---
32 files changed, 5 insertions(+), 5087 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/workflow-model/workflow-engine/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-engine/pom.xml b/modules/workflow-model/workflow-engine/pom.xml
index f5afb3d..4ffa4bf 100644
--- a/modules/workflow-model/workflow-engine/pom.xml
+++ b/modules/workflow-model/workflow-engine/pom.xml
@@ -282,13 +282,6 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-workflow-execution-context</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!--dependency> <groupId>org.apache.airavata</groupId> <artifactId>airavata-jpa-registry</artifactId> <version>${project.version}</version>
- </dependency -->
- <dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>${derby.version}</version>
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/pom.xml b/modules/xbaya-gui/pom.xml
index 1a39990..acf695f 100644
--- a/modules/xbaya-gui/pom.xml
+++ b/modules/xbaya-gui/pom.xml
@@ -252,11 +252,6 @@
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-workflow-execution-context</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>${derby.version}</version>
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
index 33012c5..06d3216 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
@@ -32,7 +32,6 @@ import java.util.Observer;
import org.apache.airavata.api.Airavata.Client;
import org.apache.airavata.model.error.AiravataClientConnectException;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
import org.apache.airavata.xbaya.file.XBayaPathConstants;
@@ -140,9 +139,6 @@ public class XBayaConfiguration extends Observable implements Observer {
private boolean regURLSetByCMD = false;
-
- private ContextHeaderDocument.ContextHeader contextHeader;
-
private Map<ThriftServiceType, ThriftClientData> thriftClientDataList = new HashMap<ThriftServiceType, ThriftClientData>();
public enum XBayaExecutionMode{
@@ -861,14 +857,6 @@ public class XBayaConfiguration extends Observable implements Observer {
this.regURLSetByCMD = regURLSetByCMD;
}
- public ContextHeaderDocument.ContextHeader getContextHeader() {
- return contextHeader;
- }
-
- public void setContextHeader(ContextHeaderDocument.ContextHeader contextHeader) {
- this.contextHeader = contextHeader;
- }
-
public Map<ThriftServiceType, ThriftClientData> getThriftClientDataList() {
return thriftClientDataList;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
index 5e34672..0c95785 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
@@ -28,7 +28,7 @@ public class XBayaVersion {
/**
* Version number
*/
- public final static Version VERSION = new Version("Airavata XBaya", 0, 11,
+ public final static Version VERSION = new Version("Airavata XBaya", 0, 15,
null, null, null);;
/**
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
index 3ecf54c..56f8bea 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
@@ -32,7 +32,6 @@ import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
import org.apache.airavata.workflow.model.graph.Port;
import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
import org.apache.airavata.workflow.model.graph.amazon.TerminateInstanceNode;
-import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
import org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode;
import org.apache.airavata.workflow.model.graph.system.BlockNode;
import org.apache.airavata.workflow.model.graph.system.ConstantNode;
@@ -60,7 +59,6 @@ import org.apache.airavata.xbaya.ui.graph.NodeGUI;
import org.apache.airavata.xbaya.ui.graph.PortGUI;
import org.apache.airavata.xbaya.ui.graph.amazon.InstanceNodeGUI;
import org.apache.airavata.xbaya.ui.graph.amazon.TerminateInstanceNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.dynamic.DynamicNodeGUI;
import org.apache.airavata.xbaya.ui.graph.subworkflow.SubWorkflowNodeGUI;
import org.apache.airavata.xbaya.ui.graph.system.BlockNodeGUI;
import org.apache.airavata.xbaya.ui.graph.system.ConstantNodeGUI;
@@ -125,8 +123,6 @@ public class NodeController {
GraphPieceGUI nodeGUI=null;
if (node instanceof SubWorkflowNode){
nodeGUI=new SubWorkflowNodeGUI((SubWorkflowNode)node);
- } else if (node instanceof DynamicNode){
- nodeGUI=new DynamicNodeGUI((DynamicNode)node);
} else if (node instanceof ConstantNode){
nodeGUI=new ConstantNodeGUI((ConstantNode)node);
} else if (node instanceof IfNode){
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
deleted file mode 100644
index a5c6366..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.ControlPort;
-import org.apache.airavata.workflow.model.graph.DataPort;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.impl.EdgeImpl;
-import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
-import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
-import org.apache.airavata.xbaya.util.InterpreterUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DoWhileHandler implements Callable<Boolean> {
- private static Logger log = LoggerFactory.getLogger(DoWhileHandler.class);
- private DoWhileNode dowhilenode;
- private Map<Node, Invoker> invokerMap;
- private ArrayList<Node> waitingNode;
- private ArrayList<Node> finishedNodes;
- private ExecutorService threadExecutor;
-
- /**
- *
- * Constructs a DoWhileHandler.
- *
- * @param node
- * @param invokerMap
- * @param waitingNode
- * @param finishedNodes
- * @param interpreter
- */
-
- public DoWhileHandler(DoWhileNode node, Map<Node, Invoker> invokerMap, ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes, ExecutorService threadExecutor) {
- this.dowhilenode = node;
- this.invokerMap = invokerMap;
- this.waitingNode = waitingNode;
- this.finishedNodes = finishedNodes;
- this.threadExecutor = threadExecutor;
- }
-
- /**
- * To evaluate dowhile condition with the input values
- *
- * @param doWhileNode
- * @param inputPorts
- * @param invokerMap
- * @return boolean value
- * @throws WorkFlowInterpreterException
- * @throws XBayaException
- */
- private boolean evaluate(DoWhileNode doWhileNode, List<DataPort> inputPorts, Map<Node, Invoker> invokerMap) throws WorkFlowInterpreterException,
- WorkflowException {
- String booleanExpression = doWhileNode.getXpath();
- if (booleanExpression == null) {
- throw new WorkFlowInterpreterException("XPath for if cannot be null");
- }
-
- int i = 0;
- for (DataPort port : inputPorts) {
- Object inputVal1 = InterpreterUtil.findInputFromPort(port, invokerMap);
- if (null == inputVal1) {
- throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + doWhileNode.getID());
- }
- booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + inputVal1 + "'");
- i++;
- }
- Boolean result = new Boolean(false);
- // Now the XPath expression
- try {
- XPathFactory xpathFact = XPathFactory.newInstance();
- XPath xpath = xpathFact.newXPath();
- result = (Boolean) xpath.evaluate(booleanExpression, booleanExpression, XPathConstants.BOOLEAN);
- } catch (XPathExpressionException e) {
- throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
- }
- return result.booleanValue();
- }
-
- /**
- * To get only web service components attached to dowhile
- *
- * @param waitingNode
- * @return list
- */
- private ArrayList<Node> handleDowhile(ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes) {
- ArrayList<Node> list = new ArrayList<Node>();
- for (Node node : waitingNode) {
- Component component = node.getComponent();
- if (component instanceof WSComponent) {
- ControlPort control = node.getControlInPort();
- boolean controlDone = true;
- if (control != null) {
- for (EdgeImpl edge : control.getEdges()) {
- controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
- || ((ControlPort) edge.getFromPort()).isConditionMet());
- }
- }
-
- /*
- * Check for input ports
- */
- List<DataPort> inputPorts = node.getInputPorts();
- boolean inputsDone = true;
- for (DataPort dataPort : inputPorts) {
- inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
- }
- if (inputsDone && controlDone) {
- list.add(node);
- }
- }
- }
-
- return list;
- }
-
- /**
- * @see java.util.concurrent.Callable#call()
- */
- @Override
- public Boolean call() throws Exception {
- log.debug("Invoked Dowhile node");
- SystemComponentInvoker dowhileinvoker = new SystemComponentInvoker();
- // TODO check for multiple input case
- Object inputVal1 = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(0), this.invokerMap);
- dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(0).getID(), inputVal1);
- this.invokerMap.put(this.dowhilenode, dowhileinvoker);
- this.finishedNodes.add(this.dowhilenode);
-
- ArrayList<Node> readyNodes = this.handleDowhile(this.waitingNode, this.finishedNodes);
-
- // When you are starting 1st time its getting input from 1st node and
- // invoking all the webservice components
- if (readyNodes.size() != 1) {
- throw new WorkflowRuntimeException("More than one dowhile execution not supported");
- }
- Node donode = readyNodes.get(0);
-// this.interpreter.handleWSComponent(donode);
- log.debug("Invoked service " + donode.getName());
-
- List<DataPort> inputPorts = this.dowhilenode.getInputPorts();
- boolean runflag = true;
- while (runflag) {
- while (true) {
- if (NodeController.isRunning(donode) || NodeController.isWaiting(donode)) {
- Thread.sleep(500);
- log.debug("Service " + donode.getName() + " waiting");
- } else if (NodeController.isFinished(donode)) {
- log.debug("Service " + donode.getName() + " Finished");
- List<DataPort> ports = this.dowhilenode.getOutputPorts();
- for (int outputPortIndex = 0, inputPortIndex = 1; outputPortIndex < ports.size(); outputPortIndex++) {
- Object inputValue = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(inputPortIndex), this.invokerMap);
- dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(outputPortIndex).getID(), inputValue);
- }
- break;
- } else if (NodeController.isFailed(donode)) {
- log.debug("Service " + donode.getName() + " Failed");
- runflag = false;
- dowhilenode.setState(NodeExecutionState.FAILED);
- this.threadExecutor.shutdown();
- return false;
- } else if (donode.isBreak()) {
- log.debug("Service " + donode.getName() + " set to break");
- runflag = false;
- break;
- } else {
- log.error("Service " + donode.getName() + " have unknow status");
- throw new WorkFlowInterpreterException("Unknow status of the node");
- }
- }
-
- this.invokerMap.put(this.dowhilenode, dowhileinvoker);
- log.debug("Going to evaluate do while expression for " + donode.getName());
- if (!evaluate(this.dowhilenode, inputPorts, this.invokerMap)) {
- log.debug("Expression evaluation is false so calling EndDoWhile");
- runflag = false;
- } else {
- if (readyNodes.size() != 1) {
- throw new WorkFlowInterpreterException("More than one dowhile execution not supported");
- }
-
- Node whileNode = readyNodes.get(0);
- log.debug("Expression evaluation is true so invoking service again " + whileNode.getName());
-
-// this.interpreter.handleWSComponent(whileNode);
- }
- }
- // WS node should be done
- dowhilenode.setState(NodeExecutionState.FINISHED);
- EndDoWhileNode endDoWhileNode = this.dowhilenode.getEndDoWhileNode();
-
- // /////////////////////////////////////////////////////////
- // // Do WHile finished execution thus we can set the //////
- // //inputs to the EndDOWHile and resume the executions/////
- SystemComponentInvoker invoker = new SystemComponentInvoker();
-
- List<DataPort> inputports = endDoWhileNode.getInputPorts();
-
- for (int inputPortIndex = 0; inputPortIndex < inputports.size(); inputPortIndex++) {
- Object inputVal = dowhileinvoker.getOutput(inputports.get(inputPortIndex).getFromPort().getID());
- invoker.addOutput(endDoWhileNode.getOutputPort(inputPortIndex).getID(), inputVal);
- }
-
- this.invokerMap.put(endDoWhileNode, invoker);
- // TODO send mail once the iterations have converged
-
- endDoWhileNode.setState(NodeExecutionState.FINISHED);
- this.threadExecutor.shutdown();
- return true;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
deleted file mode 100644
index a4706af..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.Invoker;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import xsul.wsif.WSIFMessage;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class SystemComponentInvoker implements Invoker {
-
- private Map<String, Object> outputs = new Hashtable<String, Object>();
- private static final Logger log = LoggerFactory.getLogger(SystemComponentInvoker.class);
- /**
- *
- * @param key
- * @param value
- */
- public void addOutput(String key, Object value) {
- outputs.put(key, value);
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
- */
- @Override
- public Object getOutput(String name) {
- Object out = null;
- while (out == null) {
- try {
- out = this.outputs.get(name);
- Thread.sleep(200);
- } catch (InterruptedException e) {
- log.error(e.getMessage(), e);
- }
- }
- return out;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
- */
- @Override
- public WSIFMessage getOutputs() {
- return null;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
- */
- @Override
- public boolean invoke() {
- return true;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
- */
- @Override
- public void setInput(String name, Object value) {
- }
-
- /**
- * @see org.apache.airavata.xbaya.wXPath Operatorsorkflow.Invoker#setOperation(java.lang.String)
- */
- @Override
- public void setOperation(String operationName) {
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
- */
- @Override
- public void setup() {
- }
-
- @Override
- public WSIFClient getClient() {
- return null;
- }
-
- @Override
- public WSIFMessage getInputs() throws WorkflowException {
- return null;
- }
-
- @Override
- public WSIFMessage getFault() throws WorkflowException {
- return null;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
deleted file mode 100644
index defd8c2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-import xsul.xwsif_runtime_async_http.XsulSoapHttpWsaResponsesCorrelator;
-
-public class AsynchronousInvoker extends SimpleInvoker {
-
- private static final Logger logger = LoggerFactory.getLogger(AsynchronousInvoker.class);
-
- private String messageBoxURL;
-
- /**
- * Constructs an AsynchronousInvoker.
- *
- * @param definitions
- */
- public AsynchronousInvoker(WsdlDefinitions definitions) {
- this(definitions, null);
- }
-
- /**
- * Constructs an AsynchronousInvoker.
- *
- * @param definitions
- * @param messageBoxURL
- */
- public AsynchronousInvoker(WsdlDefinitions definitions, String messageBoxURL) {
- super(definitions);
- this.messageBoxURL = messageBoxURL;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.SimpleInvoker#setup()
- */
- @Override
- public void setup() throws WorkflowException {
- super.setup();
- /* Set the output message to null to set teh output from async Listener */
- WSIFAsyncResponsesCorrelator correlator;
- if (this.messageBoxURL == null || this.messageBoxURL.length() == 0) {
- correlator = new XsulSoapHttpWsaResponsesCorrelator();
- String serverLoc = ((XsulSoapHttpWsaResponsesCorrelator) correlator).getServerLocation();
- logger.debug("using async correlator at " + serverLoc);
- } else {
- correlator = new MsgBoxWsaResponsesCorrelator(this.messageBoxURL,this);
- logger.debug("using message box at " + this.messageBoxURL);
- }
- this.client.useAsyncMessaging(correlator);
- }
-
- public boolean invoke() throws WorkflowException {
- final WSIFOperation operation = this.getOperation();
- final WSIFMessage inputMessage = this.getInputMessage();
- this.setOutputMessage(null);
- try {
- new Thread() {
- @Override
- public void run() {
- try {
- operation.executeInputOnlyOperation(inputMessage);
- } catch (Exception e) {
- // Ignore the error.
- logger.error("Error invoking GFac Service",e);
- }
- }
- }.start();
-
- while(this.getOutputMessage() == null){
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- logger.error("Error Waiting for the response from backend");
- }
- }
- // Gfac operation failed, so xbaya side throws this exception
- if("ErrorResponse".equals(XMLUtil.stringToXmlElement3(this.getOutputMessage().toString()).getName())){
- // Here we do not throw an exception, because if we throw an exception Interpreter will catch it and do the unsubscription,
- // which is not needed because if there's an gfac side error gfac will send a failure and unsubscription will be done in monitoring
- // so if we send an exception we are attempting to do two unsubscriptions which will cause a one unsubscription to fail.
- return false;
- }
-
- return true;
- } catch (RuntimeException e) {
- String message = "Error in invoking a service.";
- throw new WorkflowException(message, e);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
deleted file mode 100644
index d293fe4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import xsul.wsif.WSIFMessage;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class DynamicInvoker implements Invoker {
-
- private URL jarUrl;
-
- private String className;
-
- private String operationName;
-
- private Object[] inputs;
-
- private Object result;
-
- private static final Logger log = LoggerFactory.getLogger(DynamicInvoker.class);
- /**
- * Constructs a DynamicInvoker.
- *
- * @param className
- * @param jarUrl
- * @param operationName
- */
- public DynamicInvoker(String className, URL jarUrl, String operationName, Object[] inputs) {
- this.className = className;
- this.jarUrl = jarUrl;
- this.operationName = operationName;
- this.inputs = inputs;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#getOutput(java.lang.String)
- */
- public Object getOutput(String name) throws WorkflowException {
- waitToFinish();
- return result;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
- */
- public boolean invoke() throws WorkflowException {
- try {
- Class<?> targetClass = Class.forName(this.className);
- Object obj = targetClass.newInstance();
-
- Method[] methods = targetClass.getDeclaredMethods();
- Method targetMethod = null;
- for (Method method : methods) {
- if (this.operationName.equals(method.getName())) {
- targetMethod = method;
- break;
- }
- }
- if (targetMethod == null) {
- throw new WorkflowException("Could not find the method using reflection: " + this.operationName);
- }
-
- targetMethod.setAccessible(true);
- this.result = targetMethod.invoke(obj, inputs);
-
- } catch (Exception e) {
- throw new WorkflowException(e);
- }
- return true;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setInput(java.lang.String, java.lang.Object)
- */
- public void setInput(String name, Object value) throws WorkflowException {
-
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setOperation(java.lang.String)
- */
- public void setOperation(String operationName) throws WorkflowException {
- this.operationName = operationName;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setup()
- */
- public void setup() throws WorkflowException {
- Class[] parameters = new Class[] { URL.class };
- URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();
- Class sysclass = URLClassLoader.class;
-
- try {
- Method method = sysclass.getDeclaredMethod("addURL", parameters);
- method.setAccessible(true);
- method.invoke(sysloader, new Object[] { this.jarUrl });
- } catch (Throwable t) {
- throw new WorkflowException("Error, could not add URL to system classloader", t);
- }
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#waitToFinish()
- */
- public void waitToFinish() throws WorkflowException {
- while (this.result == null) {
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- log.error(e.getMessage(), e);
- }
- }
-
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#getOutputs()
- */
- public WSIFMessage getOutputs() throws WorkflowException {
- waitToFinish();
- return (WSIFMessage) this.result;
-
- }
-
- @Override
- public WSIFClient getClient() {
- return null;
- }
-
- @Override
- public WSIFMessage getInputs() throws WorkflowException {
- return null;
- }
-
- @Override
- public WSIFMessage getFault() throws WorkflowException {
- return null;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
deleted file mode 100644
index cc7fc2c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.io.File;
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsdl.WsdlResolver;
-
-public class DynamicServiceCreator {
-
- private String dynamicFactoryWSDLLocation;
-
- private static String classStr = "package org.apache.airavata.xbaya;" +
-
- "public class DefaultClassName{" +
-
- "public int operationName(String[] stringArray0){" +
-
- "return 8;" + "}" + "}";
-
- /**
- * Constructs a DynamicServiceCreator.
- *
- * @param dynamicFactoryWSDLLocation
- */
- public DynamicServiceCreator(String dynamicFactoryWSDLLocation) {
- this.dynamicFactoryWSDLLocation = dynamicFactoryWSDLLocation;
- }
-
- public void createService(String code) throws WorkflowException {
- try {
- WsdlDefinitions definitions = null;
- if (this.dynamicFactoryWSDLLocation != null && !this.dynamicFactoryWSDLLocation.equals("")) {
- definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
- new URI(this.dynamicFactoryWSDLLocation));
- }
-
- // Create Invoker
- // FIXME: Should pass the right leadcontext header for last argument
- Invoker invoker = InvokerFactory.createInvoker(new QName("http://extreme.indiana.edu",
- "ServiceCreatorPortType"), definitions, null, null, null);
-
- invoker.setup();
-
- invoker.setOperation("deployServiceFromClass");
- invoker.setInput("classAsString", code);
- invoker.invoke();
- invoker.getOutput("return");
- } catch (Exception e) {
- throw new WorkflowException(e);
- }
-
- }
-
- public static void main(String[] args) throws WorkflowException {
- DynamicServiceCreator c = new DynamicServiceCreator("http://127.0.0.1:8080/axis2/services/ServiceCreator?wsdl");
- c.createService(classStr);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
deleted file mode 100644
index 204427b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
+++ /dev/null
@@ -1,686 +0,0 @@
-///*
-// *
-// * Licensed to the Apache Software Foundation (ASF) und= nuer one
-// * or more contributor license agreements. See the NOTICE file
-// * distributed with this work for additional information
-// * regarding copyright ownership. The ASF licenses this file
-// * to you under the Apache License, Version 2.0 (the
-// * "License"); you may not use this file except in compliance
-// * with the License. You may obtain a copy of the License at
-// *
-// * http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing,
-// * software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// * KIND, either express or implied. See the License for the
-// * specific language governing permissions and limitations
-// * under the License.
-// *
-//*/
-//package org.apache.airavata.xbaya.invoker;
-//
-//import java.io.File;
-//import java.io.StringReader;
-//import java.net.URL;
-//import java.util.*;
-//
-//import javax.xml.namespace.QName;
-//import javax.xml.stream.XMLInputFactory;
-//import javax.xml.stream.XMLStreamException;
-//import javax.xml.stream.XMLStreamReader;
-//
-//import org.apache.airavata.client.api.AiravataAPI;
-//import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-//import org.apache.airavata.common.utils.ServerSettings;
-//import org.apache.airavata.common.utils.XMLUtil;
-//import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-//import org.apache.airavata.commons.gfac.type.ActualParameter;
-//import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-//import org.apache.airavata.commons.gfac.type.HostDescription;
-//import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.credential.store.store.CredentialReaderFactory;
-//import org.apache.airavata.gfac.Constants;
-//import org.apache.airavata.gfac.GFacConfiguration;
-//import org.apache.airavata.gfac.RequestData;
-//import org.apache.airavata.gfac.context.ApplicationContext;
-//import org.apache.airavata.gfac.context.JobExecutionContext;
-//import org.apache.airavata.gfac.context.MessageContext;
-//import org.apache.airavata.gfac.context.security.GSISecurityContext;
-//import org.apache.airavata.gfac.context.security.SSHSecurityContext;
-//import org.apache.airavata.gfac.cpi.GFacImpl;
-//import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
-//import org.apache.airavata.gfac.scheduler.HostScheduler;
-//import org.apache.airavata.gfac.utils.GFacUtils;
-//import org.apache.airavata.gsi.ssh.api.Cluster;
-//import org.apache.airavata.gsi.ssh.api.SSHApiException;
-//import org.apache.airavata.gsi.ssh.api.ServerInfo;
-//import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-//import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-//import org.apache.airavata.gsi.ssh.impl.PBSCluster;
-//import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
-//import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
-//import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-//import org.apache.airavata.gsi.ssh.util.CommonUtils;
-//import org.apache.airavata.registry.api.exception.RegistryException;
-//import org.apache.airavata.schemas.gfac.*;
-//import org.apache.airavata.schemas.wec.ContextHeaderDocument;
-//import org.apache.airavata.schemas.wec.SecurityContextDocument;
-//import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-//import org.apache.airavata.xbaya.XBayaConfiguration;
-//import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
-//import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-//import org.apache.axiom.om.OMAbstractFactory;
-//import org.apache.axiom.om.OMElement;
-//import org.apache.axiom.om.OMFactory;
-//import org.apache.axiom.om.OMNamespace;
-//import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-//import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.xmlpull.v1.builder.XmlElement;
-//
-//import xsul.wsdl.WsdlDefinitions;
-//import xsul.wsif.WSIFMessage;
-//import xsul.wsif.impl.WSIFMessageElement;
-//import xsul.xwsif_runtime.WSIFClient;
-//
-//public class EmbeddedGFacInvoker implements Invoker {
-//
-// private static final Logger logger = LoggerFactory.getLogger(EmbeddedGFacInvoker.class);
-//
-// private String nodeID;
-//
-// private QName portTypeQName;
-//
-// private String wsdlLocation;
-//
-// private String serviceInformation;
-//
-// private String messageBoxURL;
-//
-// private String gfacURL;
-//
-// private Invoker invoker;
-//
-// private XBayaConfiguration configuration;
-//
-//
-// private Boolean result;
-//
-// private ServiceNotifiable notifier;
-//
-//// private AiravataRegistry2 registry;
-//
-// private String topic;
-//
-// private String serviceName;
-//
-// private AiravataAPI airavataAPI;
-// /**
-// * used for notification
-// */
-// private List<Object> inputValues = new ArrayList<Object>();
-//
-// /**
-// * used for notification
-// */
-// private List<String> inputNames = new ArrayList<String>();
-//
-// boolean failerSent;
-//
-// private WsdlDefinitions wsdlDefinitionObject;
-//
-// private Object outPut;
-//
-// Map<String, Object> actualParameters = new LinkedHashMap<String, Object>();
-//
-// /**
-// * Creates an InvokerWithNotification.
-// *
-// * @param portTypeQName
-// * @param wsdlLocation The URL of WSDL of the service to invoke
-// * @param nodeID The ID of the service
-// * @param notifier The notification sender
-// */
-// public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, WorkflowNotifiable notifier) {
-// this(portTypeQName, wsdlLocation, nodeID, null, notifier);
-// }
-//
-// /**
-// * Creates an InvokerWithNotification.
-// *
-// * @param portTypeQName
-// * @param wsdlLocation The URL of WSDL of the service to invoke
-// * @param nodeID The ID of the service
-// * @param gfacURL The URL of GFac service.
-// * @param notifier The notification sender
-// */
-// public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String gfacURL,
-// WorkflowNotifiable notifier) {
-// this(portTypeQName, wsdlLocation, nodeID, null, gfacURL, notifier);
-// }
-//
-// /**
-// * Creates an InvokerWithNotification.
-// *
-// * @param portTypeQName
-// * @param wsdlLocation The URL of WSDL of the service to invoke
-// * @param nodeID The ID of the service
-// * @param messageBoxURL
-// * @param gfacURL The URL of GFac service.
-// * @param notifier The notification sender
-// */
-// public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String messageBoxURL,
-// String gfacURL, WorkflowNotifiable notifier) {
-// this.nodeID = nodeID;
-// this.portTypeQName = portTypeQName;
-// this.wsdlLocation = wsdlLocation;
-// this.serviceInformation = wsdlLocation;
-// this.messageBoxURL = messageBoxURL;
-// this.gfacURL = gfacURL;
-// this.notifier = notifier.createServiceNotificationSender(nodeID);
-//
-// this.failerSent = false;
-// }
-//
-// /**
-// * @param portTypeQName
-// * @param wsdl
-// * @param nodeID
-// * @param messageBoxURL
-// * @param gfacURL
-// * @param notifier
-// */
-// public EmbeddedGFacInvoker(QName portTypeQName,
-// WsdlDefinitions wsdl,
-// String nodeID,
-// String messageBoxURL,
-// String gfacURL,
-// WorkflowNotifiable notifier,
-// String topic,
-// AiravataAPI airavataAPI,
-// String serviceName,
-// XBayaConfiguration config) {
-// final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
-// this.nodeID = nodeID;
-// this.portTypeQName = portTypeQName;
-// this.wsdlDefinitionObject = wsdl;
-// this.messageBoxURL = messageBoxURL;
-// this.serviceInformation = wsdlStr;
-// this.gfacURL = gfacURL;
-// this.notifier = notifier.createServiceNotificationSender(nodeID);
-// this.airavataAPI = airavataAPI;
-// this.topic = topic;
-// this.serviceName = serviceName;
-// this.failerSent = false;
-// this.configuration = config;
-// }
-//
-// /**
-// * @throws WorkflowException
-// */
-// public void setup() throws WorkflowException {
-// this.notifier.setServiceID(this.nodeID);
-// }
-//
-// private void setup(WsdlDefinitions definitions) throws WorkflowException {
-// }
-//
-// /**
-// * @param operationName The name of the operation
-// * @throws WorkflowException
-// */
-// public void setOperation(String operationName) throws WorkflowException {
-// }
-//
-// /**
-// * @param name The name of the input parameter
-// * @param value The value of the input parameter
-// * @throws WorkflowException
-// */
-// public void setInput(String name, Object value) throws WorkflowException {
-// try {
-// if (value instanceof XmlElement) {
-// logger.debug("value: " + XMLUtil.xmlElementToString((XmlElement) value));
-// }
-// this.inputNames.add(name);
-// this.inputValues.add(value);
-// } catch (RuntimeException e) {
-// logger.error(e.getMessage(), e);
-// String message = "Error in setting an input. name: " + name + " value: " + value;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// } catch (Error e) {
-// logger.error(e.getMessage(), e);
-// String message = "Unexpected error: " + this.serviceInformation;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// } catch (Exception e) {
-// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
-// }
-// }
-//
-// /**
-// * @return
-// * @throws WorkflowException
-// */
-// public synchronized boolean invoke() throws WorkflowException {
-// try {
-// ContextHeaderDocument.ContextHeader contextHeader =
-// WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID, this.configuration.getContextHeader());
-// String hostName = null;
-// HostDescription registeredHost;
-// if (contextHeader != null) {
-// if (contextHeader.getWorkflowSchedulingContext() != null &&
-// contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray().length > 0 &&
-// contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray(0).getHostName() != null) {
-// hostName = contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray(0).getHostName();
-// }
-// }
-// //todo This is the basic scheduling, have to do proper scheduling implementation by implementing HostScheduler interface
-// ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(serviceName);
-// if (hostName == null) {
-// List<HostDescription> registeredHosts = new ArrayList<HostDescription>();
-// Map<String, ApplicationDescription> applicationDescriptors = airavataAPI.getApplicationManager().getApplicationDescriptors(serviceName);
-// for (String hostDescName : applicationDescriptors.keySet()) {
-// registeredHosts.add(airavataAPI.getApplicationManager().getHostDescription(hostDescName));
-// }
-// Class<? extends HostScheduler> aClass = Class.forName(ServerSettings.getHostScheduler()).asSubclass(HostScheduler.class);
-// HostScheduler hostScheduler = aClass.newInstance();
-// registeredHost = hostScheduler.schedule(registeredHosts);
-// } else {
-// // if user specify a host, no matter what we pick that host for all the nodes, todo: allow users to specify node specific host
-// registeredHost = airavataAPI.getApplicationManager().getHostDescription(hostName);
-// }
-// ApplicationDescription applicationDescription =
-// airavataAPI.getApplicationManager().getApplicationDescription(serviceName, registeredHost.getType().getHostName());
-//
-// // When we run getInParameters we set the actualParameter object, this has to be fixed
-// URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
-// OMElement inputMessage = getInParameters();
-// Object wsifMessageElement = new WSIFMessageElement(XMLUtil.stringToXmlElement3(inputMessage.toStringWithConsume()));
-// this.notifier.invokingService(new WSIFMessageElement((XmlElement) wsifMessageElement));
-// Properties configurationProperties = ServerSettings.getProperties();
-// GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), airavataAPI, configurationProperties);
-//
-// JobExecutionContext jobExecutionContext = new JobExecutionContext(gFacConfiguration, serviceName);
-// //Here we get only the contextheader information sent specific for this node
-// //Add security context
-//
-// //FIXME - We no longer using job execution context
-//// jobExecutionContext.setContextHeader(WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID, configuration.getContextHeader()));
-//
-//
-// jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_NODE_ID, this.nodeID);
-// jobExecutionContext.setProperty(Constants.PROP_TOPIC, this.configuration.getTopic());
-// jobExecutionContext.setProperty(Constants.PROP_BROKER_URL, this.configuration.getBrokerURL().toASCIIString());
-// jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_INSTANCE_ID, this.configuration.getTopic());
-//
-//
-// ApplicationContext applicationContext = new ApplicationContext();
-// applicationContext.setApplicationDeploymentDescription(applicationDescription);
-// applicationContext.setHostDescription(registeredHost);
-// applicationContext.setServiceDescription(serviceDescription);
-//
-// jobExecutionContext.setApplicationContext(applicationContext);
-//
-// jobExecutionContext.setOutMessageContext(getOutParameters(serviceDescription));
-// jobExecutionContext.setInMessageContext(new MessageContext(actualParameters));
-//
-// addSecurityContext(registeredHost, configurationProperties, jobExecutionContext,
-// configuration.getContextHeader());
-// GFacImpl gfacAPI1 = new GFacImpl();
-// gfacAPI1.submitJob(jobExecutionContext);
-//
-// OMFactory fac = OMAbstractFactory.getOMFactory();
-// OMNamespace omNs = fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
-// OMElement outputElement = fac.createOMElement("invokeResponse", omNs);
-// MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
-// Set<String> paramNames = outMessageContext.getParameters().keySet();
-// for (String paramName : paramNames) {
-// /*
-// * Process Output
-// */
-// String outputString = ((ActualParameter) outMessageContext.getParameter(paramName)).toXML().replaceAll("GFacParameter", paramName);
-// XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(outputString));
-// StAXOMBuilder builder = new StAXOMBuilder(reader);
-// outputElement.addChild(builder.getDocumentElement());
-// }
-// // Send notification
-// logger.debug("outputMessage: " + outputElement.toString());
-// outPut = new WSIFMessageElement(XMLUtil.stringToXmlElement3(outputElement.toStringWithConsume()));
-// this.result = true;
-// EmbeddedGFacInvoker.this.notifier.serviceFinished(new WSIFMessageElement((XmlElement) outPut));
-// //todo check whether ActualParameter values are set or not, if they are null have to through an error or handle this in gfac level.
-//// {
-//// // An implementation of WSIFMessage,
-//// // WSIFMessageElement, implements toString(), which
-//// // serialize the message XML.
-//// EmbeddedGFacInvoker.this.notifier.receivedFault(new WSIFMessageElement(XMLUtil.stringToXmlElement3("<Message>Invocation Failed</Message>")));
-//// EmbeddedGFacInvoker.this.failerSent = true;
-//// }
-//
-// } catch (RuntimeException e) {
-// logger.error(e.getMessage(), e);
-// String message = "Error in invoking a service: " + this.serviceInformation;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// } catch (Error e) {
-// logger.error(e.getMessage(), e);
-// String message = "Unexpected error: " + this.serviceInformation;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// } catch (Exception e) {
-// this.notifier.invocationFailed(e.getMessage(), e);
-// throw new WorkflowException(e.getMessage(), e);
-// }
-// return true;
-// }
-//
-// private SecurityContextDocument.SecurityContext.CredentialManagementService getCredentialManagementService(
-// ContextHeaderDocument.ContextHeader contextHeader) {
-//
-// if (contextHeader != null) {
-//
-// SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
-// = contextHeader.getSecurityContext().getCredentialManagementService();
-//
-// if (credentialManagementService != null) {
-// // Make sure token id and portal user id is properly populated
-// if (credentialManagementService.getTokenId() != null &&
-// credentialManagementService.getPortalUser() != null) {
-//
-// return credentialManagementService;
-// } else {
-// return null;
-// }
-// } else {
-// return null;
-// }
-// }
-//
-// return null;
-// }
-//
-// private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
-// JobExecutionContext jobExecutionContext, ContextHeaderDocument.ContextHeader contextHeader) throws WorkflowException {
-// RequestData requestData;
-// /* todo fix the credential store and uncomment following code block
-// SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
-// = getCredentialManagementService(contextHeader);
-//
-// GSISecurityContext context;
-//
-//
-// if (credentialManagementService != null) {
-// String gatewayId = credentialManagementService.getGatewayId();
-// String tokenId
-// = credentialManagementService.getTokenId();
-// String portalUser = credentialManagementService.getPortalUser();
-//
-// requestData = new RequestData(tokenId, portalUser, gatewayId);
-// } else {
-// requestData = new RequestData("default");
-// }
-//
-// try {
-// context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
-// } catch (Exception e) {
-// throw new WorkflowException("An error occurred while creating GSI security context", e);
-// }
-// if (registeredHost.getType() instanceof GsisshHostType) {
-// GSIAuthenticationInfo authenticationInfo
-// = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
-// requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
-// ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
-//
-// Cluster pbsCluster = null;
-// try {
-// pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-// (((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
-// } catch (SSHApiException e) {
-// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
-// }
-//
-// context.setPbsCluster(pbsCluster);
-// }
-// */
-// requestData = new RequestData("default");
-// GSISecurityContext context;
-// try {
-// context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
-// } catch (Exception e) {
-// throw new WorkflowException("An error occurred while creating GSI security context", e);
-// }
-//
-// if (registeredHost.getType() instanceof GsisshHostType) {
-// GSIAuthenticationInfo authenticationInfo
-// = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
-// requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
-// ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
-//
-// Cluster pbsCluster = null;
-// try {
-// String installedParentPath = ((HpcApplicationDeploymentType)
-// jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
-// pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-// (CommonUtils.getPBSJobManager(installedParentPath)));
-// } catch (SSHApiException e) {
-// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
-// }
-//
-// context.setPbsCluster(pbsCluster);
-// }
-//
-// jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
-// //Adding Amanzon Keys
-// if (this.configuration.getAmazonSecurityContext() != null) {
-// jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
-// this.configuration.getAmazonSecurityContext());
-// }
-// //Adding SSH security
-// String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME);
-// String sshPrivateKey = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY);
-// String sshPrivateKeyPass = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
-// String sshPassword = configurationProperties.getProperty(Constants.SSH_PASSWORD);
-// String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
-// SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
-// if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
-// AuthenticationInfo authenticationInfo = null;
-// // we give higher preference to the password over keypair ssh authentication
-// if (sshPassword != null) {
-// authenticationInfo = new DefaultPasswordAuthenticationInfo(sshPassword);
-// } else {
-// authenticationInfo = new DefaultPublicKeyFileAuthentication(sshPublicKey, sshPrivateKey, sshPrivateKeyPass);
-// }
-// ServerInfo serverInfo = new ServerInfo(sshUserName, registeredHost.getType().getHostAddress());
-//
-// Cluster pbsCluster = null;
-// try {
-// String installedParentPath = ((HpcApplicationDeploymentType)
-// jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
-// pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-// (CommonUtils.getPBSJobManager(installedParentPath)));
-// } catch (SSHApiException e) {
-// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
-// }
-// sshSecurityContext.setPbsCluster(pbsCluster);
-// sshSecurityContext.setUsername(sshUserName);
-// } else {
-// sshSecurityContext = new SSHSecurityContext();
-// sshSecurityContext.setUsername(sshUserName);
-// sshSecurityContext.setPrivateKeyLoc(sshPrivateKey);
-// sshSecurityContext.setKeyPass(sshPrivateKeyPass);
-// }
-// jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, sshSecurityContext);
-// }
-//
-// /**
-// * @throws WorkflowException
-// */
-// @SuppressWarnings("boxing")
-// public synchronized void waitToFinish() throws WorkflowException {
-// try {
-// while (this.result == null) {
-// // The job is not submitted yet.
-// try {
-// wait();
-// } catch (InterruptedException e) {
-// logger.error(e.getMessage(), e);
-// }
-// }
-// // Wait for the job to finish.
-// Boolean success = this.result;
-// if (success == false) {
-// WSIFMessage faultMessage = this.invoker.getFault();
-// String message = "Error in a service: ";
-// // An implementation of WSIFMessage,
-// // WSIFMessageElement, implements toString(), which
-// // serialize the message XML.
-// message += faultMessage.toString();
-// throw new WorkflowException(message);
-// }
-// } catch (RuntimeException e) {
-// logger.error(e.getMessage(), e);
-// String message = "Error while waiting for a service to finish: " + this.serviceInformation;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// } catch (Error e) {
-// logger.error(e.getMessage(), e);
-// String message = "Unexpected error: " + this.serviceInformation;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// }
-// }
-//
-// /**
-// * @param name The name of the output parameter
-// * @return
-// * @throws WorkflowException
-// */
-// public Object getOutput(String name) throws WorkflowException {
-// try {
-// waitToFinish();
-// if (outPut instanceof XmlElement) {
-// Iterator children = ((XmlElement) outPut).children();
-// while (children.hasNext()) {
-// Object next = children.next();
-// if (((XmlElement) next).getName().equals(name)) {
-// return ((XmlElement) ((XmlElement) next).children().next()).children().next();
-// }
-// }
-// } else {
-// return outPut;
-// }
-// } catch (WorkflowException e) {
-// logger.error(e.getMessage(), e);
-// // An appropriate message has been set in the exception.
-// if (!this.failerSent) {
-// this.notifier.invocationFailed(e.getMessage(), e);
-// }
-// throw e;
-// } catch (RuntimeException e) {
-// logger.error(e.getMessage(), e);
-// String message = "Error while waiting for a output: " + name;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// } catch (Error e) {
-// logger.error(e.getMessage(), e);
-// String message = "Unexpected error: " + this.serviceInformation;
-// this.notifier.invocationFailed(message, e);
-// throw new WorkflowException(message, e);
-// }
-// throw new WorkflowException("Output could not be found");
-// }
-//
-// /**
-// * @return
-// * @throws WorkflowException
-// */
-// public WSIFMessage getOutputs() throws WorkflowException {
-// return this.invoker.getOutputs();
-// }
-//
-// public WSIFClient getClient() {
-// return null;
-// }
-//
-// public WSIFMessage getInputs() throws WorkflowException {
-// return null;
-// }
-//
-// public WSIFMessage getFault() throws WorkflowException {
-// return null;
-// }
-//
-// private OMElement getInParameters() throws AiravataAPIInvocationException, RegistryException, XMLStreamException {
-// OMFactory omFactory = OMAbstractFactory.getOMFactory();
-// OMElement invoke_inputParams = omFactory.createOMElement(new QName("invoke_InputParams"));
-// ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(this.serviceName);
-// if (serviceDescription == null) {
-// throw new RegistryException(new Exception("Service Description not found in registry."));
-// }
-// ServiceDescriptionType serviceDescriptionType = serviceDescription.getType();
-// for (String inputName : this.inputNames) {
-// OMElement omElement = omFactory.createOMElement(new QName(inputName));
-// int index = this.inputNames.indexOf(inputName);
-// Object value = this.inputValues.get(index);
-// InputParameterType parameter = serviceDescriptionType.getInputParametersArray(index);
-// if (value instanceof XmlElement) {
-// omElement.setText((String) ((XmlElement) ((XmlElement) ((XmlElement) value).children().next()).children().next()).children().next());
-// XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(XMLUtil.xmlElementToString((XmlElement) value)));
-// StAXOMBuilder builder = new StAXOMBuilder(reader);
-// OMElement input = builder.getDocumentElement();
-//// actualParameters.put(parameter.getParameterName(), GFacUtils.getInputActualParameter(parameter, input));
-// } else if (value instanceof String) {
-// omElement.setText((String) value);
-//// actualParameters.put(parameter.getParameterName(), GFacUtils.getInputActualParameter(parameter, AXIOMUtil.stringToOM("<value>" + value + "</value>")));
-// }
-// invoke_inputParams.addChild(omElement);
-// }
-// return invoke_inputParams;
-// }
-//
-// private MessageContext getOutParameters(ServiceDescription serviceDescription) {
-// MessageContext outContext = new MessageContext();
-// for (OutputParameterType parameter : serviceDescription.getType().getOutputParametersArray()) {
-// ActualParameter actualParameter = new ActualParameter();
-// if ("String".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(StringParameterType.type);
-// } else if ("Double".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(DoubleParameterType.type);
-// } else if ("Integer".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(IntegerParameterType.type);
-// } else if ("Float".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(FloatParameterType.type);
-// } else if ("Boolean".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(BooleanParameterType.type);
-// } else if ("File".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(FileParameterType.type);
-// } else if ("URI".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(URIParameterType.type);
-// } else if ("StringArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(StringArrayType.type);
-// } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(DoubleArrayType.type);
-// } else if ("IntegerArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(IntegerArrayType.type);
-// } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(FloatArrayType.type);
-// } else if ("BooleanArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(BooleanArrayType.type);
-// } else if ("FileArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(FileArrayType.type);
-// } else if ("URIArray".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(URIArrayType.type);
-// } else if ("StdOut".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(StdOutParameterType.type);
-// } else if ("StdErr".equals(parameter.getParameterType().getName())) {
-// actualParameter.getType().changeType(StdErrParameterType.type);
-// }
-// outContext.addParameter(parameter.getParameterName(), actualParameter);
-// }
-// return outContext;
-// }
-//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/382b6c0e/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
deleted file mode 100644
index 10edbd9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.net.URI;
-import java.util.UUID;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
-import org.apache.airavata.xbaya.lead.NotificationHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsdl.WsdlResolver;
-import xsul.wsif.WSIFMessage;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class GFacInvoker implements Invoker {
-
- private final static Logger logger = LoggerFactory.getLogger(GFacInvoker.class);
-
- private String gfacURL;
-
- private String messageBoxURL;
-
- private QName portTypeQName;
-
- private Invoker invoker;
-
- private LeadContextHeader leadContext;
-
- private WorkflowContextHeaderBuilder builder;
-
- /**
- * Constructs a GFacInvoker.
- *
- * @param portTypeQName
- * @param gfacURL
- * @param messageBoxURL
- * @param context
- */
- public GFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL, LeadContextHeader context) {
- this.portTypeQName = portTypeQName;
- this.gfacURL = gfacURL;
- this.messageBoxURL = messageBoxURL;
- this.leadContext = context;
- }
-
- public GFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL, WorkflowContextHeaderBuilder context) {
- this.portTypeQName = portTypeQName;
- this.gfacURL = gfacURL;
- this.messageBoxURL = messageBoxURL;
- this.builder = context;
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
- */
- public void setup() throws WorkflowException {
-
- if (this.gfacURL == null) {
- String message = "The location of the Generic Factory is not specified.";
- throw new WorkflowException(message);
- }
-
- if (this.portTypeQName == null) {
- String message = "Error in finding the service name";
- throw new WorkflowException(message);
- }
-
- try {
-
- URI uri = new URI(this.gfacURL);
-
- /*
- * Substring to remove GfacService
- */
- String gfacPath = uri.getPath();
- if (gfacPath != null && gfacPath.contains("/")) {
- gfacPath = gfacPath.substring(0, gfacPath.lastIndexOf('/') + 1) + portTypeQName.getLocalPart();
- }
- URI getWsdlURI = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), gfacPath
- + "/getWSDL", uri.getQuery(), uri.getFragment());
-
- logger.debug("getWSDL service:" + getWsdlURI.toString());
-
- WsdlDefinitions concreteWSDL = WsdlResolver.getInstance().loadWsdl(getWsdlURI);
-
- this.invoker = InvokerFactory.createInvoker(this.portTypeQName, concreteWSDL, null, this.messageBoxURL,
- null, true);
- this.invoker.setup();
- } catch (WorkflowException xe) {
- throw xe;
- } catch (Exception e) {
- throw new WorkflowException(e.getMessage(), e);
- }
-
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#getClient()
- */
- public WSIFClient getClient() {
- return this.invoker.getClient();
- }
-
- /**
- * @throws WorkflowException
- * @see org.apache.airavata.xbaya.invoker.Invoker#setOperation(java.lang.String)
- */
- public void setOperation(String operationName) throws WorkflowException {
- this.invoker.setOperation(operationName);
- }
-
- /**
- * @throws WorkflowException
- * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
- */
- public void setInput(String name, Object value) throws WorkflowException {
- this.invoker.setInput(name, value);
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#getInputs()
- */
- public WSIFMessage getInputs() throws WorkflowException {
- return this.invoker.getInputs();
- }
-
- /**
- * @throws WorkflowException
- * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
- */
- public boolean invoke() throws WorkflowException {
-
- WSIFClient client = invoker.getClient();
- // FIXME: Temporary fix
- // if (this.leadContext == null) {
- // LeadContextHeader lh = new LeadContextHeader(UUID.randomUUID().toString(), "XBaya-User");
- // this.leadContext = lh;
- // }
- // StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-lead-header", this.leadContext);
- // client.addHandler(handler);
-
- // This handler has to be end to get the entire soap message.
- NotificationHandler notificationHandler = new NotificationHandler(this.builder);
- client.addHandler(notificationHandler);
- return this.invoker.invoke();
- }
-
- /**
- * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
- */
- public WSIFMessage getOutputs() throws WorkflowException {
- return this.invoker.getOutputs();
- }
-
- /**
- * @throws WorkflowException
- * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
- */
- public Object getOutput(String name) throws WorkflowException {
- return this.invoker.getOutput(name);
- }
-
- /**
- * @throws WorkflowException
- * @see org.apache.airavata.xbaya.invoker.Invoker#getFault()
- */
- public WSIFMessage getFault() throws WorkflowException {
- return this.invoker.getFault();
- }
-
-}
\ No newline at end of file