param-passing does work, even if in a hacky way

gskc [2002-03-20 03:02:26]
param-passing does work, even if in a hacky way
Filename
proc/nrl/NRLProcessData.java
proc/nrl/NRLProcessor.java
test/svr1/workflows/svr1/middle/Realization.class
test/svr1/workflows/svr1/middle/Realization.java
test/svr1/workflows/svr1/start/Realization.class
test/svr1/workflows/svr1/start/Realization.java
diff --git a/proc/nrl/NRLProcessData.java b/proc/nrl/NRLProcessData.java
index 6464b2a..9673b2d 100644
--- a/proc/nrl/NRLProcessData.java
+++ b/proc/nrl/NRLProcessData.java
@@ -12,8 +12,8 @@ import java.io.Serializable;
  */
 public class NRLProcessData implements Serializable {

-    /** The parameter that gets passed */
-    public HashMap param = null;
+  /** The parameter that gets passed */
+  public HashMap param = null;

   /** workflow identifier */
   public String workflowName = null;
diff --git a/proc/nrl/NRLProcessor.java b/proc/nrl/NRLProcessor.java
index 3522cd6..a8d62b3 100644
--- a/proc/nrl/NRLProcessor.java
+++ b/proc/nrl/NRLProcessor.java
@@ -61,7 +61,7 @@ public class NRLProcessor extends Processor {

   // BEGIN: Inherited from psl.survivor.proc.Processor /////////////////////////

-    private static HashMap _latestParam;
+  private static HashMap _latestParam;

   /** Initialise and setup processor */
   public NRLProcessor(String name, int tcpPort, String rmiName,
@@ -92,6 +92,7 @@ public class NRLProcessor extends Processor {

     // TODO Modify nrl's code to not use RMI, and get rid of this

+    _latestParam = new HashMap(); // TODO threads will cause problems here
     _latestParam.putAll(processData.param);

     final Object instanceId = processData.instanceId;
@@ -176,6 +177,7 @@ public class NRLProcessor extends Processor {
     NRLProcessData npd = new NRLProcessData();
     npd.workflowName = wfName;
     npd.instanceId = new Integer(_iKey);
+    npd.param = new HashMap();

     // TODO should that be "start"
     npd.originTask = "START";
@@ -238,6 +240,7 @@ public class NRLProcessor extends Processor {
                 Hashtable paramTable = outBindings;
                 String originTask = this.name; // this task is the next 'originTask'
                 NRLProcessData resultData = new NRLProcessData();
+                resultData.param = new HashMap();
                 resultData.workflowName = wfName;
                 resultData.instanceId = instanceId;
                 resultData.originTask = originTask;
@@ -254,7 +257,7 @@ public class NRLProcessor extends Processor {
                 NRLProcessData resultData = new NRLProcessData();
                 resultData.workflowName = "END";

-		_resultDataStorage.put(instanceId.toString(), resultData);
+                _resultDataStorage.put(instanceId.toString(), resultData);
               }
             }
           }; // ENDED: Scheduler_Serv
diff --git a/test/svr1/workflows/svr1/middle/Realization.class b/test/svr1/workflows/svr1/middle/Realization.class
index c12a5c2..f71fe6c 100644
Binary files a/test/svr1/workflows/svr1/middle/Realization.class and b/test/svr1/workflows/svr1/middle/Realization.class differ
diff --git a/test/svr1/workflows/svr1/middle/Realization.java b/test/svr1/workflows/svr1/middle/Realization.java
index 6c11f5c..40c65b5 100644
--- a/test/svr1/workflows/svr1/middle/Realization.java
+++ b/test/svr1/workflows/svr1/middle/Realization.java
@@ -39,8 +39,7 @@ public class Realization extends AbstractRealization{
 	  Thread.sleep(2000);
       } catch (Exception e) {;}

-      System.out.println(
-			 psl.survivor.proc.nrl.NRLProcessor.getObject());
+      System.out.println(psl.survivor.proc.nrl.NRLProcessor.getObject("key"));

       taskMgr().endTask(null);
     }
diff --git a/test/svr1/workflows/svr1/start/Realization.class b/test/svr1/workflows/svr1/start/Realization.class
index 5fd2644..be0dfb6 100644
Binary files a/test/svr1/workflows/svr1/start/Realization.class and b/test/svr1/workflows/svr1/start/Realization.class differ
diff --git a/test/svr1/workflows/svr1/start/Realization.java b/test/svr1/workflows/svr1/start/Realization.java
index 8e3e39d..057efea 100644
--- a/test/svr1/workflows/svr1/start/Realization.java
+++ b/test/svr1/workflows/svr1/start/Realization.java
@@ -40,7 +40,7 @@ public class Realization extends AbstractRealization{
       } catch (Exception e) {
       }

-      psl.survivor.proc.nrl.NRLProcessor.setObject("foo");
+      psl.survivor.proc.nrl.NRLProcessor.setObject("key", "value");

       System.out.println("DONE");
       taskMgr().endTask(null);