airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1231283 - in /incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor: WorkflowInterpreter.java WorkflowInterpretorSkeleton.java
Date Fri, 13 Jan 2012 20:28:36 GMT
Author: lahiru
Date: Fri Jan 13 20:28:36 2012
New Revision: 1231283

URL: http://svn.apache.org/viewvc?rev=1231283&view=rev
Log:
adding provenance feature to workflowInterpretor Service.

Modified:
    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

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=1231283&r1=1231282&r2=1231283&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 Jan 13 20:28:36 2012
@@ -104,7 +104,7 @@ public class WorkflowInterpreter {
 
     private static final int MAXIMUM_RETRY_TIME = 2;
 
-    public static final String WORKFLOW_STARTED = "Workflow Started";
+    public static final String WORKFLOW_STARTED = "Workflow Running";
     public static final String WORKFLOW_FINISHED = "Workflow Finished";
 
     private XBayaEngine engine;
@@ -135,7 +135,7 @@ public class WorkflowInterpreter {
 
 	private LeadResourceMapping resourceMapping;
 
-	private boolean actOnProvenance;
+	private boolean actOnProvenance = false;
 
 	private PredicatedTaskRunner provenanceWriter;
 
@@ -195,6 +195,8 @@ public class WorkflowInterpreter {
                 }
                 this.mode = SERVER_MODE;
                 this.retryFailed = false;
+            provenanceWriter = new PredicatedTaskRunner(1);
+
         }
 
 	/**
@@ -205,7 +207,7 @@ public class WorkflowInterpreter {
 	 * @param topic
 	 */
 	public WorkflowInterpreter(XBayaEngine engine, String topic) {
-		this(engine, topic, engine.getWorkflow(), false, false);
+		this(engine, topic, engine.getWorkflow(), false, engine.getConfiguration().isCollectProvenance());
 	}
 
 	/**
@@ -297,15 +299,15 @@ public class WorkflowInterpreter {
 						// recalculate the execution stack
 					}
 
-					// boolean nodeOutputLoadedFromProvenance = false;
-					// if (this.actOnProvenance) {
-					// nodeOutputLoadedFromProvenance = readProvenance(node);
-					// } else {
-					// writeProvenanceLater(node);
-					// }
-					// if (!nodeOutputLoadedFromProvenance) {
-					executeDynamically(node);
-					// }
+//					boolean nodeOutputLoadedFromProvenance = false;
+					if (this.actOnProvenance) {
+//					    nodeOutputLoadedFromProvenance = readProvenance(node);
+//					} else {
+					    writeProvenanceLater(node);
+					}
+//					if (!nodeOutputLoadedFromProvenance) {
+					    executeDynamically(node);
+//					}
 					if (this.getWorkflow().getExecutionState() == XBayaExecutionState.STEP) {
 						this.getWorkflow().setExecutionState(
 								XBayaExecutionState.PAUSED);
@@ -961,6 +963,8 @@ public class WorkflowInterpreter {
 														systemInvoker, counter,
 														inputNumbers);
 											} catch (XBayaException e) {
+
+
 												WorkflowInterpreter.this.engine
 														.getErrorWindow()
 														.error(e);

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=1231283&r1=1231282&r2=1231283&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 Jan 13 20:28:36 2012
@@ -33,6 +33,7 @@ import org.apache.airavata.xbaya.XBayaCo
 import org.apache.airavata.xbaya.XBayaException;
 import org.apache.airavata.xbaya.XBayaRuntimeException;
 import org.apache.airavata.xbaya.component.ComponentException;
+import org.apache.airavata.xbaya.component.registry.JCRComponentRegistry;
 import org.apache.airavata.xbaya.graph.GraphException;
 import org.apache.airavata.xbaya.graph.system.InputNode;
 import org.apache.airavata.xbaya.monitor.MonitorException;
@@ -42,6 +43,8 @@ import org.apache.axis2.context.Configur
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.ServiceLifeCycle;
 
+import javax.jcr.RepositoryException;
+
 /**
  * WorkflowInterpretorSkeleton java skeleton for the axisService
  */
@@ -54,6 +57,15 @@ public class WorkflowInterpretorSkeleton
 	public static final String BROKER = "broker";
     public static final String MYPROXY_USER = "myproxy.user";
     public static final String MYPROXY_PASS = "myproxy.password";
+    public static final String JCR_USER = "jcr.user";
+    public static final String JCR_PASS = "jcr.password";
+    public static final String JCR_URL = "jcr.url";
+    public static boolean provenance = false;
+    public static final String PROVENANCE = "PROVENANCE";
+    public static  String jcrUserName = "";
+    public static  String jcrPassword = "";
+    public static  String jcrURL = "";
+
 
     public void startUp(ConfigurationContext configctx, AxisService service) {
         URL url = this.getClass().getClassLoader().getResource("xbaya.properties");
@@ -62,6 +74,14 @@ public class WorkflowInterpretorSkeleton
             properties.load(url.openStream());
             configctx.setProperty(MYPROXY_PASS, properties.get(MYPROXY_PASS));
             configctx.setProperty(MYPROXY_USER, properties.get(MYPROXY_USER));
+            if("true".equals(properties.get(PROVENANCE))){
+                provenance = true;
+            }else{
+                provenance = false;
+            }
+            jcrUserName = (String)properties.get(JCR_USER);
+            jcrPassword = (String) properties.get(JCR_PASS);
+            jcrURL = (String) properties.get(JCR_URL);
         } catch (IOException e) {
             e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
         }
@@ -125,7 +145,15 @@ public class WorkflowInterpretorSkeleton
             e1.printStackTrace();
         }
 
+        try {
+            conf.setJcrComponentRegistry(new JCRComponentRegistry(new URI(jcrURL),jcrUserName,jcrPassword));
+        } catch (RepositoryException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        } catch (URISyntaxException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
         final WorkflowInterpreter interpreter = new WorkflowInterpreter(conf, topic, workflow,
username, password);
+        interpreter.setActOnProvenance(provenance);
         System.err.println("Created the interpreter");
         if(inNewThread){
             runInThread(interpreter,listener);



Mime
View raw message