Set value for option properties.

git-svn-id: 
http://taverna.googlecode.com/svn/taverna/engine/net.sf.taverna.t2.activities/trunk/dependency-activity@15954
 bf327186-88b3-11dd-a302-d386e5130c1c


Project: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/commit/205fd9a1
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/tree/205fd9a1
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/diff/205fd9a1

Branch: refs/heads/master
Commit: 205fd9a1cac245fdb7af3e80fba264774ad2569b
Parents: 76aebac
Author: [email protected] 
<[email protected]@bf327186-88b3-11dd-a302-d386e5130c1c>
Authored: Thu Jul 25 15:43:17 2013 +0000
Committer: [email protected] 
<[email protected]@bf327186-88b3-11dd-a302-d386e5130c1c>
Committed: Thu Jul 25 15:43:17 2013 +0000

----------------------------------------------------------------------
 .../AbstractAsynchronousDependencyActivity.java | 21 +++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/205fd9a1/src/main/java/net/sf/taverna/t2/activities/dependencyactivity/AbstractAsynchronousDependencyActivity.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/net/sf/taverna/t2/activities/dependencyactivity/AbstractAsynchronousDependencyActivity.java
 
b/src/main/java/net/sf/taverna/t2/activities/dependencyactivity/AbstractAsynchronousDependencyActivity.java
index 09b6e98..25c56f2 100644
--- 
a/src/main/java/net/sf/taverna/t2/activities/dependencyactivity/AbstractAsynchronousDependencyActivity.java
+++ 
b/src/main/java/net/sf/taverna/t2/activities/dependencyactivity/AbstractAsynchronousDependencyActivity.java
@@ -135,7 +135,12 @@ public abstract class 
AbstractAsynchronousDependencyActivity extends AbstractAsy
         *         classloader sharing policy
         */
        protected ClassLoader findClassLoader(JsonNode json, String 
workflowRunID) throws RuntimeException{
-               ClassLoaderSharing classLoaderSharing = 
ClassLoaderSharing.fromString(json.get("classLoaderSharing").textValue());
+               ClassLoaderSharing classLoaderSharing;
+               if (json.has("classLoaderSharing")) {
+                       classLoaderSharing = 
ClassLoaderSharing.fromString(json.get("classLoaderSharing").textValue());
+               } else {
+                       classLoaderSharing = ClassLoaderSharing.workflow;
+               }
 
                if (classLoaderSharing == ClassLoaderSharing.workflow) {
                        synchronized (workflowClassLoaders) {
@@ -236,7 +241,12 @@ public abstract class 
AbstractAsynchronousDependencyActivity extends AbstractAsy
         * retrieve the workflow) that will be added to this activity 
classloader's list of URLs.
         */
        private HashSet<URL> findDependencies(String dependencyType, JsonNode 
json, String workflowRunID) {
-               ClassLoaderSharing classLoaderSharing = 
ClassLoaderSharing.fromString(json.get("classLoaderSharing").textValue());
+               ClassLoaderSharing classLoaderSharing;
+               if (json.has("classLoaderSharing")) {
+                       classLoaderSharing = 
ClassLoaderSharing.fromString(json.get("classLoaderSharing").textValue());
+               } else {
+                       classLoaderSharing = ClassLoaderSharing.workflow;
+               }
                // Get the WorkflowInstanceFacade which contains the current 
workflow
                WeakReference<WorkflowInstanceFacade> wfFacadeRef = 
WorkflowInstanceFacade.workflowRunFacades.get(workflowRunID);
                WorkflowInstanceFacade wfFacade = null;
@@ -340,7 +350,12 @@ public abstract class 
AbstractAsynchronousDependencyActivity extends AbstractAsy
         * Finds dependencies for a nested workflow.
         */
        private HashSet<URL> findNestedDependencies(String dependencyType, 
JsonNode json, Dataflow nestedWorkflow) {
-               ClassLoaderSharing classLoaderSharing = 
ClassLoaderSharing.fromString(json.get("classLoaderSharing").textValue());
+               ClassLoaderSharing classLoaderSharing;
+               if (json.has("classLoaderSharing")) {
+                       classLoaderSharing = 
ClassLoaderSharing.fromString(json.get("classLoaderSharing").textValue());
+               } else {
+                       classLoaderSharing = ClassLoaderSharing.workflow;
+               }
 
                // Files of dependencies for all activities in the nested 
workflow that share the classloading policy
                HashSet<File> dependencies = new HashSet<File>();

Reply via email to