Author: hiranya
Date: Mon Dec 22 20:21:55 2008
New Revision: 728867

URL: http://svn.apache.org/viewvc?rev=728867&view=rev
Log:
Added a map field to the AlgorithmContext to support storing algorithm impl 
specific data. See SYNAPSE-490 for more details.


Modified:
    
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/AlgorithmContext.java

Modified: 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/AlgorithmContext.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/AlgorithmContext.java?rev=728867&r1=728866&r2=728867&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/AlgorithmContext.java
 (original)
+++ 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/algorithms/AlgorithmContext.java
 Mon Dec 22 20:21:55 2008
@@ -25,6 +25,9 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * Keeps the runtime state of the algorithm
  */
@@ -47,12 +50,15 @@
     /* The pointer to current epr - The position of the current EPR */
     private int currentEPR = 0;
 
+    private Map<String, Object> parameters;
+
     public AlgorithmContext(boolean clusteringEnabled, ConfigurationContext 
cfgCtx, String endpointName) {
         this.cfgCtx = cfgCtx;
         if (clusteringEnabled) {
             isClusteringEnabled = Boolean.TRUE;
         }
         CURRENT_EPR_PROP_KEY = KEY_PREFIX + endpointName + CURRENT_EPR;
+        parameters = new HashMap<String, Object>();
     }
 
     /**
@@ -154,4 +160,12 @@
         }
     }
 
+    public Object getParameter(String key) {
+        return parameters.get(key);
+    }
+
+    public void setParameter(String key, Object value) {
+        parameters.put(key, value);
+    }
+
 }
\ No newline at end of file


Reply via email to