You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/05/25 19:23:13 UTC

svn commit: r1342741 [1/3] - in /incubator/airavata/trunk/modules/xbaya-gui/src: main/java/org/apache/airavata/xbaya/component/registry/ main/java/org/apache/airavata/xbaya/interpretor/ main/java/org/apache/airavata/xbaya/invoker/ main/java/org/apache/...

Author: samindaw
Date: Fri May 25 17:23:11 2012
New Revision: 1342741

URL: http://svn.apache.org/viewvc?rev=1342741&view=rev
Log:
removing xbaya engine from workflow interpreter

Added:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
Modified:
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/ODEInvoker.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/taverna/TavernaRunnerWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ConstantConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DifferedInputConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndBlockConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndForEachConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndifConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ForEachConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/IfConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/InputConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/OutputConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ReceiveConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/S3FileChooser.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/StreamSourceConfigurationDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/ServiceInteractionWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorWindow.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/myproxy/MyProxyLoader.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/InstanceNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/subworkflow/SubWorkflowNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConfigurableNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConstantNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputHandler.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndBlockNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndForEachNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndifNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ForEachNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/IfNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/InputNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/OutputNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ReceiveNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/S3InputNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/StreamSourceNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WSNodeGUI.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorStarter.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/MonitorPanel.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
    incubator/airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java Fri May 25 17:23:11 2012
@@ -68,7 +68,7 @@ public class ComponentRegistryLoader imp
         this.setEngine(engine);
 
         this.loadingDialog = new WaitDialog(this, "Loading a Component List.", "Loading a Component List. "
-                + "Please wait for a moment.", this.getEngine());
+                + "Please wait for a moment.", this.getEngine().getGUI());
         getEngine().getConfiguration().addObserver(this);
     }
 

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java?rev=1342741&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java (added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java Fri May 25 17:23:11 2012
@@ -0,0 +1,165 @@
+/*
+ *
+ * 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.HashMap;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
+import org.apache.airavata.xbaya.monitor.MonitorException;
+import org.apache.airavata.xbaya.myproxy.MyProxyClient;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.graph.subworkflow.SubWorkflowNodeGUI;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.ui.utils.MyProxyChecker;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+
+public class GUIWorkflowInterpreterInteractorImpl implements
+		WorkflowInterpreterInteractor {
+	private XBayaGUI xbayaGUI;
+	private Workflow workflow;
+	private XBayaEngine engine;
+
+	private Map<String, WaitDialog> taskDialogs = new HashMap<String, WaitDialog>();
+
+	public GUIWorkflowInterpreterInteractorImpl(XBayaEngine engine,
+			Workflow workflow) {
+		this.engine = engine;
+		this.xbayaGUI = engine.getGUI();
+		this.setWorkflow(workflow);
+	}
+
+	@Override
+	public boolean notify(WorkflowExecutionMessage messageType, Object data) {
+		switch (messageType) {
+		case NODE_STATE_CHANGED:
+			xbayaGUI.getGraphCanvas().repaint();
+			break;
+		case EXECUTION_STATE_CHANGED:
+			WorkflowExecutionState state = (WorkflowExecutionState) data;
+			// if (state==WorkflowExecutionState.PAUSED ||
+			// state==WorkflowExecutionState.STOPPED) {
+			// if (getWorkflow().getExecutionState() ==
+			// WorkflowExecutionState.RUNNING
+			// || getWorkflow().getExecutionState() ==
+			// WorkflowExecutionState.STEP) {
+			// } else {
+			// throw new WorkflowRuntimeException(
+			// "Cannot pause when not running");
+			// }
+			// }
+			getWorkflow().setExecutionState(state);
+			break;
+		case EXECUTION_TASK_START:
+			TaskNotification task = (TaskNotification) data;
+			final WaitDialog waitDialog = new WaitDialog(new Cancelable() {
+				@Override
+				public void cancel() {
+					// Do nothing
+				}
+			}, task.messageTitle, task.message, this.xbayaGUI);
+			new Thread(new Runnable() {
+				@Override
+				public void run() {
+					waitDialog.show();
+				}
+			}).start();
+			taskDialogs.put(task.messageId, waitDialog);
+			break;
+		case EXECUTION_TASK_END:
+			task = (TaskNotification) data;
+			if (taskDialogs.containsKey(task.messageId)) {
+				taskDialogs.get(task.messageId).hide();
+				taskDialogs.remove(task.messageId);
+			}
+			break;
+		case EXECUTION_ERROR:
+			xbayaGUI.getErrorWindow().error((Exception) data);
+			break;
+		case OPEN_SUBWORKFLOW:
+			((SubWorkflowNodeGUI) NodeController.getGUI((Node) data))
+					.openWorkflowTab(this.engine.getGUI());
+		case EXECUTION_CLEANUP:
+			this.engine.resetWorkflowInterpreter();
+			try {
+				this.engine.getMonitor().stop();
+			} catch (MonitorException e) {
+				e.printStackTrace();
+			} finally {
+				this.engine.getMonitor().reset();
+			}
+		}
+		return false;
+	}
+
+	@Override
+	public Object retrieveData(WorkflowExecutionMessage messageType, Object data)
+			throws Exception {
+		Object result = null;
+		switch (messageType) {
+		case INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW:
+			WorkflowExecutionData widata = (WorkflowExecutionData) data;
+            XBayaConfiguration conf = this.engine.getConfiguration();
+            WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getJcrComponentRegistry().getRegistry(), conf, engine.getGUI(), new MyProxyChecker(this.engine), this.engine.getMonitor());
+			result = new WorkflowInterpreter(workflowInterpreterConfiguration, widata.topic,
+					widata.workflow, true, false,
+					new GUIWorkflowInterpreterInteractorImpl(engine,
+							widata.workflow));
+			this.engine.registerWorkflowInterpreter((WorkflowInterpreter)result);
+			break;
+		case INPUT_GSS_CREDENTIAL:
+			MyProxyChecker myProxyChecker = new MyProxyChecker(this.engine);
+			myProxyChecker.loadIfNecessary();
+			MyProxyClient myProxyClient = this.engine.getMyProxyClient();
+			result = myProxyClient.getProxy();
+			break;
+		case INPUT_LEAD_CONTEXT_HEADER:
+			WSNodeData w = (WSNodeData) data;
+			result = XBayaUtil.buildLeadContextHeader(this.getWorkflow(),
+					w.currentInterpreter.getConfig().getConfiguration(),
+					new MonitorConfiguration(w.currentInterpreter
+							.getConfig().getMessageBrokerURL(),
+							w.currentInterpreter.getTopic(), true,
+							w.currentInterpreter.getConfig()
+									.getMessageBoxURL()), w.wsNode.getID(),
+					null);
+			break;
+		}
+		return result;
+	}
+
+	public Workflow getWorkflow() {
+		return workflow;
+	}
+
+	public void setWorkflow(Workflow workflow) {
+		this.workflow = workflow;
+	}
+
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java?rev=1342741&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java (added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java Fri May 25 17:23:11 2012
@@ -0,0 +1,91 @@
+/*
+ *
+ * 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 org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
+import org.apache.airavata.xbaya.security.SecurityUtil;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+
+public class SSWorkflowInterpreterInteractorImpl implements
+		WorkflowInterpreterInteractor {
+	private Workflow workflow;
+
+	public SSWorkflowInterpreterInteractorImpl(Workflow workflow) {
+		this.workflow = workflow;
+	}
+
+	@Override
+	public boolean notify(WorkflowExecutionMessage messageType, Object data) {
+		switch (messageType) {
+		case NODE_STATE_CHANGED:
+			break;
+		case EXECUTION_STATE_CHANGED:
+			WorkflowExecutionState state = (WorkflowExecutionState) data;
+			if (state == WorkflowExecutionState.PAUSED
+					|| state == WorkflowExecutionState.STOPPED) {
+				workflow.setExecutionState(WorkflowExecutionState.STOPPED);
+			}
+			break;
+		case EXECUTION_TASK_START:
+			break;
+		case EXECUTION_TASK_END:
+			break;
+		}
+		return false;
+	}
+
+	@Override
+	public Object retrieveData(WorkflowExecutionMessage messageType, Object data)
+			throws Exception {
+		Object result = null;
+		switch (messageType) {
+		case INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW:
+			WorkflowExecutionData widata = (WorkflowExecutionData) data;
+            WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(widata.currentInterpreter.getConfig().getMessageBoxURL(), widata.currentInterpreter.getConfig().getMessageBrokerURL(), widata.currentInterpreter.getConfig().getRegistry(), widata.currentInterpreter.getConfig().getConfiguration(), widata.currentInterpreter.getConfig().getGUI(), widata.currentInterpreter.getConfig().getMyProxyChecker(), widata.currentInterpreter.getConfig().getMonitor());
+			result = new WorkflowInterpreter(workflowInterpreterConfiguration
+					, widata.topic,
+					widata.workflow, widata.currentInterpreter.getUsername(),
+					widata.currentInterpreter.getPassword(),
+					new SSWorkflowInterpreterInteractorImpl(widata.workflow));
+			break;
+		case INPUT_GSS_CREDENTIAL:
+			WorkflowInterpreter w = (WorkflowInterpreter) data;
+			result = SecurityUtil.getGSSCredential(w.getUsername(),
+					w.getPassword(), w.getConfig().getConfiguration().getMyProxyServer());
+			break;
+		case INPUT_LEAD_CONTEXT_HEADER:
+			WSNodeData d = (WSNodeData) data;
+			result = XBayaUtil.buildLeadContextHeader(d.currentInterpreter
+					.getWorkflow(), d.currentInterpreter.getConfig().getConfiguration(),
+					new MonitorConfiguration(d.currentInterpreter
+							.getConfig().getMessageBrokerURL(),
+							d.currentInterpreter.getTopic(), true,
+							d.currentInterpreter.getConfig().getMessageBoxURL()), d.wsNode.getID(),
+					null);
+			break;
+		}
+		return result;
+	}
+
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java?rev=1342741&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java (added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java Fri May 25 17:23:11 2012
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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;
+
+public enum WorkflowExecutionMessage {
+	NODE_STATE_CHANGED, 
+	//this.engine.getGUI().getGraphCanvas().repaint();
+	EXECUTION_STATE_CHANGED,
+	EXECUTION_RESUME,
+	EXECUTION_TASK_START,
+	EXECUTION_TASK_END,
+	EXECUTION_ERROR,
+	EXECUTION_CLEANUP,
+	OPEN_SUBWORKFLOW,
+	INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW,
+	INPUT_GSS_CREDENTIAL,
+	INPUT_LEAD_CONTEXT_HEADER,
+	INPUT_GFAC_INVOKER,
+}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java Fri May 25 17:23:11 2012
@@ -85,11 +85,10 @@ import org.apache.airavata.workflow.mode
 import org.apache.airavata.workflow.model.ode.ODEClient;
 import org.apache.airavata.workflow.model.wf.Workflow;
 import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
 import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
 import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterInteractor.WorkflowExecutionData;
 import org.apache.airavata.xbaya.invoker.DynamicInvoker;
 import org.apache.airavata.xbaya.invoker.EmbeddedGFacInvoker;
 import org.apache.airavata.xbaya.invoker.GenericInvoker;
@@ -100,10 +99,8 @@ import org.apache.airavata.xbaya.jython.
 import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
 import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
 import org.apache.airavata.xbaya.monitor.MonitorException;
-import org.apache.airavata.xbaya.myproxy.MyProxyClient;
 import org.apache.airavata.xbaya.provenance.ProvenanceReader;
 import org.apache.airavata.xbaya.provenance.ProvenanceWrite;
-import org.apache.airavata.xbaya.security.SecurityUtil;
 import org.apache.airavata.xbaya.security.XBayaSecurity;
 import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
 import org.apache.airavata.xbaya.ui.graph.NodeGUI;
@@ -111,12 +108,9 @@ import org.apache.airavata.xbaya.ui.grap
 import org.apache.airavata.xbaya.ui.graph.system.DifferedInputHandler;
 import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
 import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.apache.airavata.xbaya.ui.utils.MyProxyChecker;
 import org.apache.airavata.xbaya.util.AmazonUtil;
 import org.apache.airavata.xbaya.util.InterpreterUtil;
 import org.apache.airavata.xbaya.util.XBayaUtil;
-import org.apache.axis2.context.ConfigurationContext;
-import org.ietf.jgss.GSSCredential;
 import org.xmlpull.infoset.XmlElement;
 
 import xsul.lead.LeadContextHeader;
@@ -135,8 +129,10 @@ public class WorkflowInterpreter {
 	public static final String WORKFLOW_STARTED = "Workflow Running";
 	public static final String WORKFLOW_FINISHED = "Workflow Finished";
 
-	private XBayaEngine engine;
+//	private XBayaEngine engine;
 
+	private WorkflowInterpreterConfiguration config;
+	
 //	private Map<Node, Integer> retryCounter = new HashMap<Node, Integer>();
 
 	private Map<Node, Invoker> invokerMap = new HashMap<Node, Invoker>();
@@ -145,15 +141,13 @@ public class WorkflowInterpreter {
 
 //	private boolean retryFailed = false;
 
-	private MyProxyChecker myProxyChecker;
-
 	private Workflow workflow;
 
     private WSGraph graph;
 
 	private boolean isSubWorkflow;
 
-	private XBayaConfiguration configuration;
+//	private XBayaConfiguration configuration;
 
 	private int mode;
 
@@ -174,8 +168,8 @@ public class WorkflowInterpreter {
 	private boolean runWithCrossProduct = false;
 
 	private boolean isoffline = false;
-
-    private ConfigurationContext configurationContext;
+	
+	private WorkflowInterpreterInteractor interactor;
 
 	/**
 	 * 
@@ -187,18 +181,19 @@ public class WorkflowInterpreter {
 	 * @param username
 	 * @param password
 	 */
-	public WorkflowInterpreter(XBayaConfiguration configuration, String topic,
-			Workflow workflow, String username, String password) {
-		this.configuration = configuration;
-		this.username = username;
-		this.password = password;
-		this.topic = topic;
+	public WorkflowInterpreter(WorkflowInterpreterConfiguration config, String topic,
+			Workflow workflow, String username, String password, WorkflowInterpreterInteractor interactor) {
+		this.setConfig(config);
+		this.setUsername(username);
+		this.setPassword(password);
+		this.setTopic(topic);
 		this.workflow = workflow;
         this.graph = workflow.getGraph();
         this.notifier = new NotificationSender(
-				this.configuration.getBrokerURL(), topic);
+				this.getConfig().getConfiguration().getBrokerURL(), topic);
 		this.mode = SERVER_MODE;
-		this.runWithCrossProduct = this.configuration.isRunWithCrossProduct();
+		this.runWithCrossProduct = this.getConfig().getConfiguration().isRunWithCrossProduct();
+		this.interactor=interactor;
 	}
 
 	/**
@@ -211,13 +206,13 @@ public class WorkflowInterpreter {
 	 * @param username
 	 * @param password
 	 */
-	public WorkflowInterpreter(XBayaConfiguration configuration, String topic,
+	public WorkflowInterpreter(WorkflowInterpreterConfiguration config, String topic,
 			Workflow workflow, String username, String password, boolean offline) {
 		this.isoffline = offline;
-		this.configuration = configuration;
-		this.username = username;
-		this.password = password;
-		this.topic = topic;
+		this.setConfig(config);
+		this.setUsername(username);
+		this.setPassword(password);
+		this.setTopic(topic);
 		this.workflow = workflow;
         this.graph = workflow.getGraph();
 		if (this.isoffline) {
@@ -236,9 +231,9 @@ public class WorkflowInterpreter {
 	 * @param engine
 	 * @param topic
 	 */
-	public WorkflowInterpreter(XBayaEngine engine, String topic) {
-		this(engine, topic, engine.getGUI().getWorkflow(), false, engine
-				.getConfiguration().isCollectProvenance());
+	public WorkflowInterpreter(WorkflowInterpreterConfiguration config, String topic, WorkflowInterpreterInteractor interactor) {
+		this(config, topic, config.getGUI().getWorkflow(), false, config
+				.getConfiguration().isCollectProvenance(),interactor);
 	}
 
 	/**
@@ -250,21 +245,21 @@ public class WorkflowInterpreter {
 	 * @param workflow
 	 * @param subWorkflow
 	 */
-	public WorkflowInterpreter(XBayaEngine engine, String topic,
-			Workflow workflow, boolean subWorkflow, boolean actOnProvenance) {
-		this.engine = engine;
-		this.configuration = engine.getConfiguration();
-		this.myProxyChecker = new MyProxyChecker(this.engine);
+	public WorkflowInterpreter(WorkflowInterpreterConfiguration config, String topic,
+			Workflow workflow, boolean subWorkflow, boolean actOnProvenance, WorkflowInterpreterInteractor interactor) {
+//		this.engine = engine;
+		this.setConfig(config);
 		this.workflow = workflow;
         this.graph = workflow.getGraph();
 		this.isSubWorkflow = subWorkflow;
 		this.mode = GUI_MODE;
 		this.notifier = new NotificationSender(
-				this.configuration.getBrokerURL(), topic);
-		this.topic = topic;
+				this.getConfig().getConfiguration().getBrokerURL(), topic);
+		this.setTopic(topic);
 		this.actOnProvenance = actOnProvenance;
-		this.runWithCrossProduct = this.configuration.isRunWithCrossProduct();
-		engine.registerWorkflowInterpreter(this);
+		this.runWithCrossProduct = this.getConfig().getConfiguration().isRunWithCrossProduct();
+//		engine.registerWorkflowInterpreter(this);
+		this.interactor=interactor;
 
 	}
 
@@ -272,6 +267,15 @@ public class WorkflowInterpreter {
 		this.resourceMapping = resourceMapping;
 	}
 
+	private void notifyViaInteractor(WorkflowExecutionMessage messageType, Object data){
+		interactor.notify(messageType, data);
+	}
+	
+	private Object getInputViaInteractor(WorkflowExecutionMessage messageType, Object data) throws Exception{
+		return interactor.retrieveData(messageType, data);
+	}
+	
+	
 	/**
 	 * @throws WorkflowException
 	 */
@@ -286,10 +290,10 @@ public class WorkflowInterpreter {
 			this.getWorkflow().setExecutionState(WorkflowExecutionState.RUNNING);
 			if (actOnProvenance) {
 				try {
-					this.configuration
+					this.getConfig().getConfiguration()
 							.getJcrComponentRegistry()
 							.getRegistry()
-							.saveWorkflowExecutionStatus(this.topic,
+							.saveWorkflowExecutionStatus(this.getTopic(),
 									ExecutionStatus.STARTED);
 				} catch (RegistryException e) {
 					throw new WorkflowException(e);
@@ -301,15 +305,14 @@ public class WorkflowInterpreter {
 			for (int i = 0; i < inputNodes.size(); ++i) {
 				Node node = inputNodes.get(i);
 				NodeController.getGUI(node).setBodyColor(NodeState.FINISHED.color);
-				if (this.mode == GUI_MODE) {
-					this.engine.getGUI().getGraphCanvas().repaint();
-				}
+				interactor.notify(WorkflowExecutionMessage.NODE_STATE_CHANGED, null);
 				keywords[i] = ((InputNode) node).getName();
 				values[i] = ((InputNode) node).getDefaultValue();
 			}
 			this.notifier.workflowStarted(values, keywords);
 			while (this.getWorkflow().getExecutionState() != WorkflowExecutionState.STOPPED) {
 				if (getRemainNodesDynamically() == 0) {
+//					notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.PAUSED);
 					if (this.mode == GUI_MODE) {
 						this.notifyPause();
 					} else {
@@ -382,10 +385,10 @@ public class WorkflowInterpreter {
 				if (actOnProvenance) {
 					try {
 						try {
-							this.configuration
+							this.getConfig().getConfiguration()
 									.getJcrComponentRegistry()
 									.getRegistry()
-									.saveWorkflowExecutionStatus(this.topic,
+									.saveWorkflowExecutionStatus(this.getTopic(),
 											ExecutionStatus.FINISHED);
 						} catch (Exception e) {
 							throw new WorkflowException(e);
@@ -393,15 +396,15 @@ public class WorkflowInterpreter {
 					} catch (Exception e) {
 						throw new WorkflowException(e);
 					}
-					// System.out.println(this.configuration.getJcrComponentRegistry().getRegistry().getWorkflowStatus(this.topic));
+					// System.out.println(this.config.getConfiguration().getJcrComponentRegistry().getRegistry().getWorkflowStatus(this.topic));
 				}
 			} else {
 				if (actOnProvenance) {
 					try {
-						this.configuration
+						this.getConfig().getConfiguration()
 								.getJcrComponentRegistry()
 								.getRegistry()
-								.saveWorkflowExecutionStatus(this.topic,
+								.saveWorkflowExecutionStatus(this.getTopic(),
 										ExecutionStatus.FAILED);
 					} catch (RegistryException e) {
 						throw new WorkflowException(e);
@@ -416,7 +419,7 @@ public class WorkflowInterpreter {
 						// Do nothing
 					}
 				}, "Stop Workflow", "Cleaning up resources for Workflow",
-						this.engine);
+						this.config.getGUI());
 				new Thread(new Runnable() {
 					@Override
 					public void run() {
@@ -437,6 +440,22 @@ public class WorkflowInterpreter {
 			} else {
 				finish();
 			}
+//			UUID uuid = UUID.randomUUID();
+//			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_START, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow", "Cleaning up resources for Workflow",uuid.toString()));
+//			// Send Notification for output values
+//			finish();
+//			// Sleep to provide for notification delay
+//			try {
+//				Thread.sleep(1000);
+//			} catch (InterruptedException e) {
+//				e.printStackTrace();
+//			}
+//			cleanup();
+//			if (notifier!=null){
+//				this.notifier.cleanup();
+//			}
+//			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_END, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow", "Cleaning up resources for Workflow",uuid.toString()));
+
 			this.workflow.setExecutionState(WorkflowExecutionState.NONE);
 		} catch (RuntimeException e) {
 			// we reset all the state
@@ -515,31 +534,37 @@ public class WorkflowInterpreter {
 			this.provenanceWriter = new PredicatedTaskRunner(1);
 		}
 		this.provenanceWriter.scedule(new ProvenanceWrite(node, this
-				.getWorkflow().getName(), invokerMap, this.topic,
-				this.configuration.getJcrComponentRegistry().getRegistry()));
+				.getWorkflow().getName(), invokerMap, this.getTopic(),
+				this.getConfig().getConfiguration().getJcrComponentRegistry().getRegistry()));
 	}
 
 	/**
 	 * @param e
 	 */
 	public void raiseException(Throwable e) {
+//		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_ERROR, e);
+//		throw new RuntimeException(e);
 		if (this.mode == GUI_MODE) {
-			this.engine.getGUI().getErrorWindow().error(e);
+			this.config.getGUI().getErrorWindow().error(e);
 		} else {
 			throw new RuntimeException(e);
 		}
-
 	}
 
 	/**
      *
      */
 	private void notifyPause() {
+//		if (this.getWorkflow().getExecutionState() != WorkflowExecutionState.RUNNING
+//				&& this.getWorkflow().getExecutionState() != WorkflowExecutionState.STEP) {
+//			throw new WorkflowRuntimeException("Cannot pause when not running");
+//		}
+//		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.PAUSED);
 		if (this.mode == GUI_MODE) {
 
 			if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.RUNNING
 					|| this.getWorkflow().getExecutionState() == WorkflowExecutionState.STEP) {
-				this.engine.getGUI().getToolbar().getPlayAction()
+				this.config.getGUI().getToolbar().getPlayAction()
 						.actionPerformed(null);
 			} else {
 				throw new WorkflowRuntimeException("Cannot pause when not running");
@@ -552,14 +577,15 @@ public class WorkflowInterpreter {
 	 */
 	public void cleanup() throws MonitorException {
 		this.workflow.setExecutionState(WorkflowExecutionState.STOPPED);
-		if (this.mode == GUI_MODE) {
-			this.engine.resetWorkflowInterpreter();
-			try {
-				this.engine.getMonitor().stop();
-			} finally {
-				this.engine.getMonitor().reset();
-			}
-		}
+		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_CLEANUP, null);
+//		if (this.mode == GUI_MODE) {
+//			this.engine.resetWorkflowInterpreter();
+//			try {
+//				this.engine.getMonitor().stop();
+//			} finally {
+//				this.engine.getMonitor().reset();
+//			}
+//		}
 	}
 
 	private void sendOutputsDynamically() throws WorkflowException {
@@ -597,18 +623,18 @@ public class WorkflowInterpreter {
 					if (actOnProvenance) {
 						try {
 							if (val instanceof String) {
-								this.configuration
+								this.getConfig().getConfiguration()
 										.getJcrComponentRegistry()
 										.getRegistry()
 										.saveWorkflowExecutionOutput(
-												this.topic, node.getName(),
+												this.getTopic(), node.getName(),
 												val.toString());
 							} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
-								this.configuration
+								this.getConfig().getConfiguration()
 										.getJcrComponentRegistry()
 										.getRegistry()
 										.saveWorkflowExecutionOutput(
-												this.topic,
+												this.getTopic(),
 												node.getName(),
 												XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
 							}
@@ -663,18 +689,18 @@ public class WorkflowInterpreter {
 					if (actOnProvenance) {
 						try {
 							if (val instanceof String) {
-								this.configuration
+								this.getConfig().getConfiguration()
 										.getJcrComponentRegistry()
 										.getRegistry()
 										.saveWorkflowExecutionOutput(
-												this.topic, node.getName(),
+												this.getTopic(), node.getName(),
 												val.toString());
 							} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
-								this.configuration
+								this.getConfig().getConfiguration()
 										.getJcrComponentRegistry()
 										.getRegistry()
 										.saveWorkflowExecutionOutput(
-												this.topic,
+												this.getTopic(),
 												node.getName(),
 												XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
 							}
@@ -748,8 +774,9 @@ public class WorkflowInterpreter {
 	}
 
 	private void handleSubWorkComponent(Node node) throws WorkflowException {
+//		notifyViaInteractor(WorkflowExecutionMessage.OPEN_SUBWORKFLOW, node);
 		if ((this.mode == GUI_MODE) && (node instanceof SubWorkflowNodeGUI)) {
-			((SubWorkflowNodeGUI) NodeController.getGUI(node)).openWorkflowTab(this.engine);
+			((SubWorkflowNodeGUI) NodeController.getGUI(node)).openWorkflowTab(this.config.getGUI());
 		}
 		// setting the inputs
 		Workflow subWorkflow = ((SubWorkflowNode) node).getWorkflow();
@@ -785,14 +812,20 @@ public class WorkflowInterpreter {
 
 		}
 
-		if (this.mode == GUI_MODE) {
-			new WorkflowInterpreter(this.engine, this.topic, subWorkflow, true,
-					false).scheduleDynamically();
-		} else {
-			new WorkflowInterpreter(this.configuration, this.topic,
-					subWorkflow, this.username, this.password)
-					.scheduleDynamically();
+		try {
+			WorkflowInterpreter subworkflowInterpreter = (WorkflowInterpreter)getInputViaInteractor(WorkflowExecutionMessage.INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW, new WorkflowExecutionData(subWorkflow,this.getTopic(), this));
+			subworkflowInterpreter.scheduleDynamically();
+		} catch (Exception e) {
+			throw new WorkflowException(e);
 		}
+//		if (this.mode == GUI_MODE) {
+//			new WorkflowInterpreter(getConfig(), this.topic, subWorkflow, true,
+//					false, new GUIWorkflowInterpreterInteractorImpl(engine, workflow)).scheduleDynamically();
+//		} else {
+//			new WorkflowInterpreter(this.getConfig(), this.topic,
+//					subWorkflow, this.getUsername(), this.getPassword(),new SSWorkflowInterpreterInteractorImpl(workflow))
+//					.scheduleDynamically();
+//		}
 	}
 
 	private void handleWSComponent(Node node) throws WorkflowException {
@@ -806,38 +839,31 @@ public class WorkflowInterpreter {
 		}
 		final WSNode wsNode = (WSNode) node;
 		String wsdlLocation = InterpreterUtil.getEPR(wsNode);
-		final String gfacURLString = this.configuration.getGFacURL().toString();
+		final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
 		if (null == wsdlLocation) {
 			if (gfacURLString.startsWith("https")) {
-				GSSCredential proxy = null;
-				if (this.mode == GUI_MODE) {
-					this.myProxyChecker.loadIfNecessary();
-					MyProxyClient myProxyClient = this.engine
-							.getMyProxyClient();
-					proxy = myProxyClient.getProxy();
-				} else {
-					proxy = SecurityUtil.getGSSCredential(this.username,
-							this.password,
-							this.configuration.getMyProxyServer());
-				}
-
-				LeadContextHeader leadCtxHeader = null;
+				LeadContextHeader leadCtxHeader=null;
+//				try {
+//					leadCtxHeader = (LeadContextHeader)getInputViaInteractor(WorkflowExecutionMessage.INPUT_LEAD_CONTEXT_HEADER, new WSNodeData(wsNode,this));
+//				} catch (Exception e1) {
+//					throw new WorkflowException(e1);
+//				}
 				try {
 					if (this.mode == GUI_MODE) {
 						leadCtxHeader = XBayaUtil.buildLeadContextHeader(
 								this.getWorkflow(),
-								this.configuration,
-								new MonitorConfiguration(this.configuration
-										.getBrokerURL(), this.topic, true,
-										this.configuration.getMessageBoxURL()),
+								this.getConfig().getConfiguration(),
+								new MonitorConfiguration(this.getConfig().getConfiguration()
+										.getBrokerURL(), this.getTopic(), true,
+										this.getConfig().getConfiguration().getMessageBoxURL()),
 								wsNode.getID(), null);
 					} else {
 						leadCtxHeader = XBayaUtil.buildLeadContextHeader(
 								this.getWorkflow(),
-								this.configuration,
-								new MonitorConfiguration(this.configuration
-										.getBrokerURL(), this.topic, true,
-										this.configuration.getMessageBoxURL()),
+								this.getConfig().getConfiguration(),
+								new MonitorConfiguration(this.getConfig().getConfiguration()
+										.getBrokerURL(), this.getTopic(), true,
+										this.getConfig().getConfiguration().getMessageBoxURL()),
 								wsNode.getID(), null);
 					}
 				} catch (URISyntaxException e) {
@@ -901,49 +927,62 @@ public class WorkflowInterpreter {
 				}
 
 				invoker = new WorkflowInvokerWrapperForGFacInvoker(
-						portTypeQName, gfacURLString, this.engine.getMonitor()
+						portTypeQName, gfacURLString, this.config.getMonitor()
 								.getConfiguration().getMessageBoxURL()
 								.toString(), leadCtxHeader,
 						this.notifier.createServiceNotificationSender(node
 								.getID()));
 
 			} else {
+//				invoker=(Invoker)getInputViaInteractor(WorkflowExecutionMessage.INPUT_GFAC_INVOKER, new GFacInvokerData(gfacEmbeddedMode,portTypeQName,
+//                        WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode
+//                                .getComponent().getWSDL()), node.getID(),
+//                        this.engine.getMonitor().getConfiguration()
+//                                .getMessageBoxURL().toASCIIString(),
+//                        this.engine.getMonitor().getConfiguration().getBrokerURL().toASCIIString(), this.notifier, this.getTopic(),
+//                        this.engine.getConfiguration().getJcrComponentRegistry().getRegistry(),
+//                        portTypeQName.getLocalPart(),this.engine.getConfiguration()));
 				if (this.mode == GUI_MODE) {
 					// if user configure the msgBox url using the UI we have to
 					// pick the latest one which
 					// set by the UI
                     if (this.gfacEmbeddedMode) {
                         invoker = new EmbeddedGFacInvoker(portTypeQName,
-                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode
-                                        .getComponent().getWSDL()), node.getID(),
-                                this.engine.getMonitor().getConfiguration()
-                                        .getMessageBoxURL().toASCIIString(),
-                                this.engine.getMonitor().getConfiguration().getBrokerURL().toASCIIString(), this.notifier, this.topic,
-                                this.engine.getConfiguration().getJcrComponentRegistry().getRegistry(),
-                                portTypeQName.getLocalPart(),this.engine.getConfiguration());
+                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), 
+                                node.getID(),
+                                this.config.getMonitor().getConfiguration().getMessageBoxURL().toASCIIString(),
+                                this.config.getMonitor().getConfiguration().getBrokerURL().toASCIIString(), 
+                                this.notifier, 
+                                this.getTopic(),
+                                this.config.getRegistry(),
+                                portTypeQName.getLocalPart(),
+                                this.config.getConfiguration());
                     } else {
                         invoker = new GenericInvoker(portTypeQName,
-                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode
-                                        .getComponent().getWSDL()), node.getID(),
-                                this.engine.getMonitor().getConfiguration()
-                                        .getMessageBoxURL().toASCIIString(),
-                                gfacURLString, this.notifier);
+                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), 
+                                node.getID(),
+                                this.config.getMonitor().getConfiguration().getMessageBoxURL().toASCIIString(),
+                                gfacURLString, 
+                                this.notifier);
                     }
 				} else {
                     if(this.gfacEmbeddedMode){
                         invoker = new EmbeddedGFacInvoker(portTypeQName,
-                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode
-                                        .getComponent().getWSDL()), node.getID(),
-                                this.configuration.getMessageBoxURL()
-                                        .toASCIIString(),
-                                this.configuration.getBrokerURL().toASCIIString(), this.notifier, this.topic, configuration.getJcrComponentRegistry().getRegistry(),
-                                portTypeQName.getLocalPart(),this.configuration);
+                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), 
+                                node.getID(),
+                                this.getConfig().getMessageBoxURL().toASCIIString(),
+                                this.getConfig().getMessageBrokerURL().toASCIIString(), 
+                                this.notifier, 
+                                this.getTopic(), 
+                                getConfig().getRegistry(),
+                                portTypeQName.getLocalPart(),
+                                this.getConfig().getConfiguration());
                     }else{
                         invoker = new GenericInvoker(portTypeQName,
-                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode
-                                        .getComponent().getWSDL()), node.getID(),
-                                this.configuration.getMessageBoxURL()
-                                        .toASCIIString(), gfacURLString,
+                                WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), 
+                                node.getID(),
+                                this.getConfig().getMessageBoxURL().toASCIIString(), 
+                                gfacURLString,
                                 this.notifier);
 
                     }
@@ -959,7 +998,7 @@ public class WorkflowInterpreter {
 				wsdlLocation += "?wsdl";
 			}
 			invoker = new GenericInvoker(portTypeQName, wsdlLocation,
-					node.getID(), this.configuration.getMessageBoxURL()
+					node.getID(), this.getConfig().getConfiguration().getMessageBoxURL()
 							.toString(), gfacURLString, this.notifier);
 		}
 		invoker.setup();
@@ -1155,7 +1194,7 @@ public class WorkflowInterpreter {
 												finalMap, counter, inputNumbers);
 									} catch (WorkflowException e) {
 
-										WorkflowInterpreter.this.engine
+										WorkflowInterpreter.this.config
 												.getGUI().getErrorWindow().error(e);
 									}
 								}
@@ -1255,7 +1294,7 @@ public class WorkflowInterpreter {
 										foreachWSNode, finalEndForEachNodes,
 										finalInvokerMap, counter, inputNumbers);
 							} catch (WorkflowException e) {
-								WorkflowInterpreter.this.engine
+								WorkflowInterpreter.this.config
 										.getGUI().getErrorWindow().error(e);
 							}
 						}
@@ -1383,48 +1422,37 @@ public class WorkflowInterpreter {
 		QName portTypeQName = wsComponent.getPortTypeQName();
 		if (null == wsdlLocation) {
 			if (gfacURLString.startsWith("https")) {
-				GSSCredential proxy = null;
-				if (this.mode == GUI_MODE) {
-					this.myProxyChecker.loadIfNecessary();
-					MyProxyClient myProxyClient = this.engine
-							.getMyProxyClient();
-					proxy = myProxyClient.getProxy();
-				} else {
-					proxy = SecurityUtil.getGSSCredential(this.username,
-							this.password,
-							this.configuration.getMyProxyServer());
-				}
 				LeadContextHeader leadCtxHeader = null;
 				try {
 					if (this.mode == GUI_MODE) {
 						leadCtxHeader = XBayaUtil.buildLeadContextHeader(
 								this.getWorkflow(),
-								this.configuration,
-								new MonitorConfiguration(this.configuration
-										.getBrokerURL(), this.topic, true,
-										this.configuration.getMessageBoxURL()),
+								this.getConfig().getConfiguration(),
+								new MonitorConfiguration(this.getConfig().getConfiguration()
+										.getBrokerURL(), this.getTopic(), true,
+										this.getConfig().getConfiguration().getMessageBoxURL()),
 								foreachWSNode.getID(), null);
 					} else {
 						leadCtxHeader = XBayaUtil.buildLeadContextHeader(
 								this.getWorkflow(),
-								this.configuration,
-								new MonitorConfiguration(this.configuration
-										.getBrokerURL(), this.topic, true,
-										this.configuration.getMessageBoxURL()),
+								this.getConfig().getConfiguration(),
+								new MonitorConfiguration(this.getConfig().getConfiguration()
+										.getBrokerURL(), this.getTopic(), true,
+										this.getConfig().getConfiguration().getMessageBoxURL()),
 								foreachWSNode.getID(), null);
 					}
 				} catch (URISyntaxException e) {
 					throw new WorkflowException(e);
 				}
 				invoker = new WorkflowInvokerWrapperForGFacInvoker(
-						portTypeQName, gfacURLString, this.configuration
+						portTypeQName, gfacURLString, this.getConfig().getConfiguration()
 								.getMessageBoxURL().toString(), leadCtxHeader,
 						this.notifier
 								.createServiceNotificationSender(foreachWSNode
 										.getID()));
 			} else {
 				invoker = new GenericInvoker(portTypeQName, wsdlLocation,
-						foreachWSNode.getID(), this.configuration
+						foreachWSNode.getID(), this.getConfig().getConfiguration()
 								.getMessageBoxURL().toString(), gfacURLString,
 						this.notifier);
 			}
@@ -1438,7 +1466,7 @@ public class WorkflowInterpreter {
 				wsdlLocation += "?wsdl";
 			}
 			invoker = new GenericInvoker(portTypeQName, wsdlLocation,
-					foreachWSNode.getID(), this.configuration
+					foreachWSNode.getID(), this.getConfig().getConfiguration()
 							.getMessageBoxURL().toString(), gfacURLString,
 					this.notifier);
 		}
@@ -1458,7 +1486,7 @@ public class WorkflowInterpreter {
 					inputNumber);
 			for (final Iterator<String> iterator = inputValues.iterator(); iterator
 					.hasNext();) {
-				final String gfacURLString = this.configuration.getGFacURL()
+				final String gfacURLString = this.getConfig().getConfiguration().getGFacURL()
 						.toString();
 				final String input = iterator.next();
 				WSComponent wsComponent = (WSComponent) middleNode
@@ -1476,7 +1504,7 @@ public class WorkflowInterpreter {
 									inputNumber, input, invoker2);
 
 						} catch (WorkflowException e) {
-							WorkflowInterpreter.this.engine.getGUI().getErrorWindow()
+							WorkflowInterpreter.this.config.getGUI().getErrorWindow()
 									.error(e);
 						}
 					}
@@ -1486,7 +1514,7 @@ public class WorkflowInterpreter {
 				try {
 					Thread.sleep(3000);
 				} catch (InterruptedException e) {
-					WorkflowInterpreter.this.engine.getGUI().getErrorWindow().error(e);
+					WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
 				}
 			}
 		} else {
@@ -1494,7 +1522,7 @@ public class WorkflowInterpreter {
 			for (Iterator<String> iterator = listOfValues.iterator(); iterator
 					.hasNext();) {
 				String input = iterator.next();
-				final String gfacURLString = this.configuration.getGFacURL()
+				final String gfacURLString = this.getConfig().getConfiguration().getGFacURL()
 						.toString();
 
 				WSComponent wsComponent = (WSComponent) middleNode
@@ -1622,7 +1650,7 @@ public class WorkflowInterpreter {
 			invoker.setOperation(wsComponent.getOperationName());
 		} else if (middleNode instanceof SubWorkflowNode) {
 			// ((SubWorkflowNode) middleNode).getWorkflow();
-			// this.configuration;
+			// this.config.getConfiguration();
 			// TODO : Need to create a invoker!
 			// new WorkflowInterpreter()
 		} else {
@@ -1836,7 +1864,7 @@ public class WorkflowInterpreter {
 			ArrayList<Node> waitingNodes = InterpreterUtil.getWaitingNodesDynamically(this.graph);
 			for (Node readyNode : waitingNodes) {
 				DifferedInputHandler.handleDifferredInputsofDependentNodes(
-						readyNode, engine);
+						readyNode, config.getGUI());
 			}
 		}
 
@@ -1871,11 +1899,35 @@ public class WorkflowInterpreter {
         return gfacEmbeddedMode;
     }
 
-    public XBayaConfiguration getConfiguration() {
-        return configuration;
-    }
+	public String getUsername() {
+		return username;
+	}
 
-    public void setConfiguration(XBayaConfiguration configuration) {
-        this.configuration = configuration;
-    }
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public String getTopic() {
+		return topic;
+	}
+
+	public void setTopic(String topic) {
+		this.topic = topic;
+	}
+
+	public WorkflowInterpreterConfiguration getConfig() {
+		return config;
+	}
+
+	public void setConfig(WorkflowInterpreterConfiguration config) {
+		this.config = config;
+	}
 }
\ No newline at end of file

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java?rev=1342741&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java (added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java Fri May 25 17:23:11 2012
@@ -0,0 +1,94 @@
+/*
+ *
+ * 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.net.URI;
+
+import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.monitor.Monitor;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.utils.MyProxyChecker;
+
+public class WorkflowInterpreterConfiguration {
+	private URI messageBoxURL;
+	private URI messageBrokerURL;
+	private AiravataRegistry registry;
+	private XBayaConfiguration configuration;
+	private XBayaGUI gui;
+	private MyProxyChecker myProxyChecker;
+	private Monitor monitor;
+	
+	public WorkflowInterpreterConfiguration(URI messageBoxURL,URI messageBrokerURL,AiravataRegistry registry,XBayaConfiguration configuration,XBayaGUI gui,MyProxyChecker myProxyChecker,Monitor monitor) {
+		this.messageBoxURL = messageBoxURL;
+		this.messageBrokerURL = messageBrokerURL;
+		this.registry = registry;
+		this.configuration = configuration;
+		this.gui = gui;
+		this.myProxyChecker = myProxyChecker;
+		this.monitor = monitor;
+	}
+	
+	public URI getMessageBoxURL() {
+		return messageBoxURL;
+	}
+	public void setMessageBoxURL(URI messageBoxURL) {
+		this.messageBoxURL = messageBoxURL;
+	}
+	public URI getMessageBrokerURL() {
+		return messageBrokerURL;
+	}
+	public void setMessageBrokerURL(URI messageBrokerURL) {
+		this.messageBrokerURL = messageBrokerURL;
+	}
+	public AiravataRegistry getRegistry() {
+		return registry;
+	}
+	public void setRegistry(AiravataRegistry registry) {
+		this.registry = registry;
+	}
+	public XBayaConfiguration getConfiguration() {
+		return configuration;
+	}
+	public void setConfiguration(XBayaConfiguration configuration) {
+		this.configuration = configuration;
+	}
+	public XBayaGUI getGUI() {
+		return gui;
+	}
+	public void setGUI(XBayaGUI gui) {
+		this.gui = gui;
+	}
+	public MyProxyChecker getMyProxyChecker() {
+		return myProxyChecker;
+	}
+	public void setMyProxyChecker(MyProxyChecker myProxyChecker) {
+		this.myProxyChecker = myProxyChecker;
+	}
+	public Monitor getMonitor() {
+		return monitor;
+	}
+	public void setMonitor(Monitor monitor) {
+		this.monitor = monitor;
+	}
+	
+}

Added: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java?rev=1342741&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java (added)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java Fri May 25 17:23:11 2012
@@ -0,0 +1,96 @@
+/*
+ *
+ * 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 javax.xml.namespace.QName;
+
+import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
+
+import xsul.wsdl.WsdlDefinitions;
+
+public interface WorkflowInterpreterInteractor {
+	public boolean notify(WorkflowExecutionMessage messageType, Object data);
+	public Object retrieveData(WorkflowExecutionMessage messageType, Object data) throws Exception;
+	public static class TaskNotification{
+		String messageTitle;
+		String message;
+		String messageId;
+		public TaskNotification(String messageTitle, String message, String messageId) {
+			this.messageTitle=messageTitle;
+			this.message=message;
+			this.messageId=messageId;
+		}
+	}
+	
+	public static class WorkflowExecutionData{
+		Workflow workflow;
+		String topic;
+		WorkflowInterpreter currentInterpreter;
+		public WorkflowExecutionData(Workflow workflow,String topic, WorkflowInterpreter currentInterpreter) {
+			this.workflow=workflow;
+			this.topic=topic;
+			this.currentInterpreter=currentInterpreter;
+		}
+	}
+	
+	public static class WSNodeData{
+		WSNode wsNode;
+		WorkflowInterpreter currentInterpreter;
+		public WSNodeData(WSNode wsNode, WorkflowInterpreter currentInterpreter) {
+			this.wsNode=wsNode;
+			this.currentInterpreter=currentInterpreter;
+		}
+	}
+	
+	public static class GFacInvokerData{
+		QName portTypeQName;
+		WsdlDefinitions wsdl;
+		String nodeID;
+		String messageBoxURL;
+        String gfacURL;
+        WorkflowNotifiable notifier;
+        String topic;
+        AiravataRegistry registry;
+        String serviceName;
+        XBayaConfiguration config;
+        boolean embeddedMode;
+        
+        public GFacInvokerData(boolean embeddedMode, QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
+                String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry registry,String serviceName,XBayaConfiguration config) {
+        	this.embeddedMode=embeddedMode;
+        	this.portTypeQName = portTypeQName;
+        	this.wsdl = wsdl;
+        	this.nodeID = nodeID;
+        	this.messageBoxURL = messageBoxURL;
+        	this.gfacURL = gfacURL;
+        	this.notifier = notifier;
+        	this.topic = topic;
+        	this.registry = registry;
+        	this.serviceName = serviceName;
+        	this.config = config;
+		}
+	}
+}

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java Fri May 25 17:23:11 2012
@@ -21,11 +21,25 @@
 
 package org.apache.airavata.xbaya.interpretor;
 
-import java.io.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jcr.RepositoryException;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.common.registry.api.impl.JCRRegistry;
@@ -46,32 +60,16 @@ import org.apache.airavata.xbaya.XBayaCo
 import org.apache.airavata.xbaya.XBayaConstants;
 import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
 import org.apache.airavata.xbaya.monitor.MonitorException;
-import org.apache.airavata.xbaya.workflow.proxy.WorkflowContext;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
 import org.apache.axiom.soap.SOAPHeader;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.ServiceLifeCycle;
 import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-import xsul5.MLogger;
 
-import javax.jcr.RepositoryException;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
+import xsul5.MLogger;
 
 /**
  * WorkflowInterpretorSkeleton java skeleton for the axisService
@@ -254,9 +252,10 @@ public class WorkflowInterpretorSkeleton
         }
         WorkflowInterpretorEventListener listener = null;
         WorkflowInterpreter interpreter = null;
+        WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getJcrComponentRegistry().getRegistry(), conf, null, null, null);
         if (Boolean.parseBoolean(configurations.get(WITH_LISTENER))) {
             listener = new WorkflowInterpretorEventListener(workflow, conf);
-            interpreter = new WorkflowInterpreter(conf, topic, workflow, username, password);
+            interpreter = new WorkflowInterpreter(workflowInterpreterConfiguration, topic, workflow, username, password, new SSWorkflowInterpreterInteractorImpl(workflow));
 
             try {
                 System.err.println("start listener set");
@@ -265,7 +264,7 @@ public class WorkflowInterpretorSkeleton
                 e1.printStackTrace();
             }
         } else {
-            interpreter = new WorkflowInterpreter(conf, topic, workflow, username, password, true);
+            interpreter = new WorkflowInterpreter(workflowInterpreterConfiguration, topic, workflow, username, password, true);
         }
 
         WorkflowContextHeaderBuilder.setCurrentContextHeader(builder.getContextHeader());

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/ODEInvoker.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/ODEInvoker.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/ODEInvoker.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/ODEInvoker.java Fri May 25 17:23:11 2012
@@ -65,7 +65,7 @@ public class ODEInvoker implements Cance
         this.engine = engine;
 
         this.invokingDialog = new WaitDialog(this, "Invoking the Workflow.", "Invoking the Workflow."
-                + "Please wait for a moment.", this.engine);
+                + "Please wait for a moment.", this.engine.getGUI());
     }
 
     /**

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/taverna/TavernaRunnerWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/taverna/TavernaRunnerWindow.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/taverna/TavernaRunnerWindow.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/taverna/TavernaRunnerWindow.java Fri May 25 17:23:11 2012
@@ -40,13 +40,17 @@ import org.apache.airavata.workflow.mode
 import org.apache.airavata.workflow.model.graph.system.InputNode;
 import org.apache.airavata.workflow.model.graph.util.GraphUtil;
 import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
 import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.interpretor.GUIWorkflowInterpreterInteractorImpl;
 import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
 import org.apache.airavata.xbaya.jython.script.JythonScript;
 import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
 import org.apache.airavata.xbaya.scufl.script.ScuflScript;
 import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
 import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.utils.MyProxyChecker;
 import org.apache.airavata.xbaya.ui.widgets.GridPanel;
 import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
 import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
@@ -264,7 +268,12 @@ public class TavernaRunnerWindow {
                     MonitorConfiguration notifConfig = TavernaRunnerWindow.this.engine.getMonitor().getConfiguration();
                     TavernaRunnerWindow.this.engine.getMonitor().start();
                     notifConfig.setTopic(topicString);
-                    new WorkflowInterpreter(TavernaRunnerWindow.this.engine, topicString).scheduleDynamically();
+                    XBayaConfiguration conf = TavernaRunnerWindow.this.engine.getConfiguration();
+                    WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getJcrComponentRegistry().getRegistry(), conf, TavernaRunnerWindow.this.engine.getGUI(), new MyProxyChecker(TavernaRunnerWindow.this.engine), TavernaRunnerWindow.this.engine.getMonitor());
+
+                    WorkflowInterpreter workflowInterpreter = new WorkflowInterpreter(workflowInterpreterConfiguration, topicString, new GUIWorkflowInterpreterInteractorImpl(engine, engine.getGUI().getWorkflow()));
+                    TavernaRunnerWindow.this.engine.registerWorkflowInterpreter(workflowInterpreter);
+					workflowInterpreter.scheduleDynamically();
                 } catch (WorkflowException e) {
                     TavernaRunnerWindow.this.engine.getGUI().getErrorWindow().error(e);
                 }

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java Fri May 25 17:23:11 2012
@@ -49,7 +49,7 @@ public class WaitDialogTestCase extends 
                 // Nothing
             }
         };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine);
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
         Thread showThread = new Thread() {
             @Override
             public void run() {
@@ -77,7 +77,7 @@ public class WaitDialogTestCase extends 
                 // Nothing
             }
         };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine);
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
         Thread showThread1 = new Thread() {
             @Override
             public void run() {
@@ -125,7 +125,7 @@ public class WaitDialogTestCase extends 
                 // Nothing
             }
         };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine);
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
         Thread showThread1 = new Thread() {
             @Override
             public void run() {
@@ -186,7 +186,7 @@ public class WaitDialogTestCase extends 
                 // Nothing
             }
         };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine);
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
         Thread showThread1 = new Thread() {
             @Override
             public void run() {
@@ -233,7 +233,7 @@ public class WaitDialogTestCase extends 
                 // Nothing
             }
         };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine);
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
         Thread showThread1 = new Thread() {
             @Override
             public void run() {

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java Fri May 25 17:23:11 2012
@@ -566,7 +566,7 @@ public class XBayaGUI implements EventLi
         this.componentViewer = new ComponentViewer();
         this.componentSelector = new ComponentSelector(this.engine);
         this.componentSelector.addComponentSelectorListener(this.componentViewer);
-        this.monitorPane = new MonitorPanel(this.engine);
+        this.monitorPane = new MonitorPanel(this.engine.getGUI(),this.engine.getMonitor());
 
         compTreeXBayapanel = new ScrollPanel(this.componentSelector, ComponentSelector.TITLE);
         ScrollPanel compViewXBayaPanel = new ScrollPanel(this.componentViewer, ComponentViewer.TITLE);
@@ -837,4 +837,8 @@ public class XBayaGUI implements EventLi
         }
 
     }
+
+	public XBayaConfiguration getConfiguration() {
+		return engine.getConfiguration();
+	}
 }
\ No newline at end of file

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java Fri May 25 17:23:11 2012
@@ -33,7 +33,7 @@ import javax.swing.SwingConstants;
 import javax.swing.WindowConstants;
 
 import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
 import org.apache.airavata.xbaya.ui.utils.Cancelable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,7 +42,7 @@ public class WaitDialog {
 
     private static final Logger logger = LoggerFactory.getLogger(WaitDialog.class);
 
-    private XBayaEngine engine;
+    private XBayaGUI xbayaGUI;
 
     private Cancelable cancelable;
 
@@ -62,11 +62,11 @@ public class WaitDialog {
      * @param message
      * @param engine
      */
-    public WaitDialog(Cancelable cancelable, String title, String message, XBayaEngine engine) {
+    public WaitDialog(Cancelable cancelable, String title, String message, XBayaGUI xbayaGUI) {
         this.cancelable = cancelable;
         this.title = title;
         this.message = message;
-        this.engine = engine;
+        this.xbayaGUI = xbayaGUI;
         this.done = true;
     }
 
@@ -121,7 +121,7 @@ public class WaitDialog {
         JPanel buttonPanel = new JPanel();
         buttonPanel.add(cancelButton);
 
-        this.dialog = new XBayaDialog(this.engine.getGUI(), this.title, label, buttonPanel);
+        this.dialog = new XBayaDialog(this.xbayaGUI, this.title, label, buttonPanel);
 
         this.dialog.getDialog().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
         this.dialog.getDialog().setCursor(SwingUtil.WAIT_CURSOR);

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java Fri May 25 17:23:11 2012
@@ -179,7 +179,7 @@ public class AmazonS3UtilsWindow {
                     return;
                 }
                 AmazonS3UtilsWindow.this.s3Tree.clean();
-                BucketsLoader bucketsLoader = new BucketsLoader(xBayaEngine, window.dialog.getDialog());
+                BucketsLoader bucketsLoader = new BucketsLoader(xBayaEngine.getGUI(), window.dialog.getDialog());
                 bucketsLoader.load(getS3Service(), AmazonS3UtilsWindow.this.s3Tree);
             }
         });

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java Fri May 25 17:23:11 2012
@@ -25,7 +25,7 @@ import javax.swing.JDialog;
 import javax.swing.JOptionPane;
 import javax.swing.tree.DefaultMutableTreeNode;
 
-import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
 import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
 import org.apache.airavata.xbaya.ui.utils.Cancelable;
 import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
@@ -37,7 +37,7 @@ import org.jets3t.service.model.S3Object
 
 public class BucketsLoader implements Cancelable {
 
-    private XBayaEngine engine;
+    private XBayaGUI xbayaGUI;
     private JDialog parent;
 
     private boolean canceled;
@@ -50,11 +50,11 @@ public class BucketsLoader implements Ca
      * @param engine
      * @param parent
      */
-    public BucketsLoader(XBayaEngine engine, JDialog parent) {
-        this.engine = engine;
+    public BucketsLoader(XBayaGUI xbayaGUI, JDialog parent) {
+        this.xbayaGUI=xbayaGUI;
         this.parent = parent;
         this.loadingDialog = new WaitDialog(this, "Loading S3 Buckets.", "Loading S3 Buckets.\n"
-                + "Please wait for a moment.", this.engine);
+                + "Please wait for a moment.", this.xbayaGUI);
     }
 
     /**
@@ -111,7 +111,7 @@ public class BucketsLoader implements Ca
                     S3TreeModel.getInstance().connect();
 
                 } catch (S3ServiceException ex) {
-                    BucketsLoader.this.engine.getGUI().getErrorWindow().error(BucketsLoader.this.parent,
+                    BucketsLoader.this.xbayaGUI.getErrorWindow().error(BucketsLoader.this.parent,
                             "Cannot List S3 buckets", ex);
                 } finally {
                     BucketsLoader.this.loadingDialog.hide();

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java Fri May 25 17:23:11 2012
@@ -57,7 +57,7 @@ public class InstancesLoader implements 
         this.engine = engine;
         this.parent = parent;
         this.loadingDialog = new WaitDialog(this, "Loading EC2 Instances.", "Loading EC2 Instances.\n"
-                + "Please wait for a moment.", this.engine);
+                + "Please wait for a moment.", this.engine.getGUI());
     }
 
     /**

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java Fri May 25 17:23:11 2012
@@ -55,7 +55,7 @@ public class S3Downloader implements Can
         this.engine = engine;
         this.parent = parent;
         this.loadingDialog = new WaitDialog(this, "Downloading file from S3.", "Downloading file from S3.\n"
-                + "Please wait for a moment.", this.engine);
+                + "Please wait for a moment.", this.engine.getGUI());
     }
 
     /**

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java Fri May 25 17:23:11 2012
@@ -50,7 +50,7 @@ public class S3Uploader implements Cance
         this.engine = engine;
         this.parent = parent;
         this.loadingDialog = new WaitDialog(this, "Uploading file to S3.", "Uploading file to S3.\n"
-                + "Please wait for a moment.", this.engine);
+                + "Please wait for a moment.", this.engine.getGUI());
     }
 
     /**

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java?rev=1342741&r1=1342740&r2=1342741&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java Fri May 25 17:23:11 2012
@@ -32,7 +32,7 @@ import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 
 import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
-import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
 import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
 import org.apache.airavata.xbaya.ui.widgets.GridPanel;
 import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
@@ -41,7 +41,7 @@ import org.apache.airavata.xbaya.ui.widg
 import org.apache.airavata.xbaya.util.AmazonUtil;
 
 public class InstanceConfigurationDialog {
-    private XBayaEngine engine;
+    private XBayaGUI xbayaGUI;
 
     private InstanceNode node;
 
@@ -62,8 +62,8 @@ public class InstanceConfigurationDialog
      * @param node
      * @param engine
      */
-    public InstanceConfigurationDialog(InstanceNode node, XBayaEngine engine) {
-        this.engine = engine;
+    public InstanceConfigurationDialog(InstanceNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
         this.node = node;
         initGui();
     }
@@ -178,13 +178,13 @@ public class InstanceConfigurationDialog
             public void actionPerformed(ActionEvent e) {
                 if (InstanceConfigurationDialog.this.idTextField.getText() == null
                         || InstanceConfigurationDialog.this.idTextField.getText().isEmpty()) {
-                    InstanceConfigurationDialog.this.engine.getGUI().getErrorWindow()
+                    InstanceConfigurationDialog.this.xbayaGUI.getErrorWindow()
                             .error("Please input AMI ID or Instance ID");
                     return;
                 }
                 if (InstanceConfigurationDialog.this.usernameTextField.getText() == null
                         || InstanceConfigurationDialog.this.usernameTextField.getText().isEmpty()) {
-                    InstanceConfigurationDialog.this.engine.getGUI().getErrorWindow().error(
+                    InstanceConfigurationDialog.this.xbayaGUI.getErrorWindow().error(
                             "Please input username to access instance");
                     return;
                 }
@@ -218,7 +218,7 @@ public class InstanceConfigurationDialog
         buttonPanel.add(okButton);
         buttonPanel.add(cancelButton);
 
-        this.dialog = new XBayaDialog(this.engine.getGUI(), "Instance Configuration", gridPanel, buttonPanel);
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Instance Configuration", gridPanel, buttonPanel);
         this.dialog.setDefaultButton(okButton);
     }
 }
\ No newline at end of file