Return-Path: X-Original-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 33B7F998C for ; Fri, 13 Jan 2012 20:28:59 +0000 (UTC) Received: (qmail 43651 invoked by uid 500); 13 Jan 2012 20:28:58 -0000 Delivered-To: apmail-incubator-airavata-commits-archive@incubator.apache.org Received: (qmail 43602 invoked by uid 500); 13 Jan 2012 20:28:58 -0000 Mailing-List: contact airavata-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: airavata-dev@incubator.apache.org Delivered-To: mailing list airavata-commits@incubator.apache.org Received: (qmail 43592 invoked by uid 99); 13 Jan 2012 20:28:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jan 2012 20:28:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jan 2012 20:28:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BCC9923888E7; Fri, 13 Jan 2012 20:28:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: airavata-commits@incubator.apache.org From: lahiru@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120113202836.BCC9923888E7@eris.apache.org> 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);