You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2012/01/30 21:21:31 UTC
svn commit: r1237967 - in
/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya:
interpretor/ jython/lib/
Author: lahiru
Date: Mon Jan 30 20:21:30 2012
New Revision: 1237967
URL: http://svn.apache.org/viewvc?rev=1237967&view=rev
Log:
fixing some threading issue which harm the long run of WorkflowInterpreter service.
Modified:
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.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/jython/lib/NotificationSender.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java?rev=1237967&r1=1237966&r2=1237967&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java Mon Jan 30 20:21:30 2012
@@ -1,24 +1,24 @@
-/*
- *
- * 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.
- *
- */
-
+/*
+ *
+ * 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;
@@ -122,4 +122,9 @@ public class StandaloneNotificationSende
return new StandaloneServiceNotificationSender(this.workflow, this.workflowID);
}
+ @Override
+ public void cleanup(){
+
+ }
+
}
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=1237967&r1=1237966&r2=1237967&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 Mon Jan 30 20:21:30 2012
@@ -535,6 +535,7 @@ public class WorkflowInterpreter {
this.engine.getMonitor().reset();
}
}
+ this.notifier.cleanup();
}
private void sendOutputsDynamically() throws XBayaException {
@@ -648,6 +649,7 @@ public class WorkflowInterpreter {
}
this.notifier.sendingPartialResults(outputValues.toArray(),
outputKeywords.toArray(new String[outputKeywords.size()]));
+ cleanup();
}
private void executeDynamically(final Node node) throws XBayaException {
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=1237967&r1=1237966&r2=1237967&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 Mon Jan 30 20:21:30 2012
@@ -34,6 +34,7 @@ import org.apache.airavata.xbaya.XBayaEx
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.concurrent.PredicatedTaskRunner;
import org.apache.airavata.xbaya.graph.GraphException;
import org.apache.airavata.xbaya.graph.system.InputNode;
import org.apache.airavata.xbaya.monitor.MonitorException;
@@ -67,6 +68,7 @@ public class WorkflowInterpretorSkeleton
public static String jcrURL = "";
public static boolean runInThread = false;
public static final String RUN_IN_THREAD = "runInThread";
+ private static PredicatedTaskRunner runner = null;
public void startUp(ConfigurationContext configctx, AxisService service) {
@@ -78,6 +80,7 @@ public class WorkflowInterpretorSkeleton
configctx.setProperty(MYPROXY_USER, properties.get(MYPROXY_USER));
if("true".equals(properties.get(PROVENANCE))){
provenance = true;
+ runner = new PredicatedTaskRunner(1);
}else{
provenance = false;
}
@@ -163,6 +166,7 @@ public class WorkflowInterpretorSkeleton
}
final WorkflowInterpreter interpreter = new WorkflowInterpreter(conf, topic, workflow, username, password);
interpreter.setActOnProvenance(provenance);
+ interpreter.setProvenanceWriter(runner);
System.err.println("Created the interpreter");
if(inNewThread){
runInThread(interpreter,listener);
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java?rev=1237967&r1=1237966&r2=1237967&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java Mon Jan 30 20:21:30 2012
@@ -276,4 +276,9 @@ public class NotificationSender implemen
return new ServiceNotificationSender(this.notifier, this.eventSink, this.initiator, this.workflowID, nodeID,
this.context);
}
+
+ @Override
+ public void cleanup(){
+ this.notifier.delete();
+ }
}
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java?rev=1237967&r1=1237966&r2=1237967&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java Mon Jan 30 20:21:30 2012
@@ -1,24 +1,24 @@
-/*
- *
- * 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.
- *
- */
-
+/*
+ *
+ * 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.jython.lib;
import org.apache.axis2.addressing.EndpointReference;
@@ -85,4 +85,6 @@ public interface WorkflowNotifiable {
*/
public abstract ServiceNotifiable createServiceNotificationSender(String nodeID);
+ public abstract void cleanup();
+
}
\ No newline at end of file