synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject svn commit: r595227 - in /webservices/synapse/trunk/java/modules: core/src/main/java/org/apache/synapse/ core/src/main/java/org/apache/synapse/core/axis2/ core/src/main/java/org/apache/synapse/mediators/eip/ core/src/main/java/org/apache/synapse/util/ ...
Date Thu, 15 Nov 2007 07:05:09 GMT
Author: ruwan
Date: Wed Nov 14 23:05:02 2007
New Revision: 595227

URL: http://svn.apache.org/viewvc?rev=595227&view=rev
Log:
Fixing an issue with CloneMessageContext

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/Target.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
    webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
    webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/TestMessageContext.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/MessageContext.java
Wed Nov 14 23:05:02 2007
@@ -31,6 +31,7 @@
 
 import java.util.Set;
 import java.util.Stack;
+import java.util.Map;
 
 
 /**
@@ -68,6 +69,23 @@
      * @param se the reference to the Synapse Environment
      */
     public void setEnvironment(SynapseEnvironment se);
+
+    /**
+     * Return all the entries which are in the MessageContext. This does not represent
+     * all the declared entries in the configuration, rather only the entries that the
+     * context has already used. This will not lookup for the entries in the Configuration.
+     * @return the set of local entries in the context
+     */
+    public Map getContextEntries();
+
+    /**
+     * Sets the entries to the current context and not to the configuration. This can be
+     * used to focely override an existing set of resources in the configuration, because
+     * the resource lookup will look for the context first. But this only sets the entries
+     * to the current context
+     * @param entries the set of local entries to be set
+     */
+    public void setContextEntries(Map entries);
 
     /**
      * Return the main sequence from the configuration, or the local message context

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2MessageContext.java
Wed Nov 14 23:05:02 2007
@@ -101,6 +101,14 @@
         this.synEnv = synEnv;
     }
 
+    public Map getContextEntries() {
+        return localEntries;
+    }
+
+    public void setContextEntries(Map entries) {
+        this.localEntries = entries;
+    }
+
     public Mediator getMainSequence() {
         Object o = localEntries.get(SynapseConstants.MAIN_SEQUENCE_KEY);
         if (o != null && o instanceof Mediator) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/Target.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/Target.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/Target.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/Target.java
Wed Nov 14 23:05:02 2007
@@ -83,7 +83,7 @@
         if (sequence != null) {
             synCtx.getEnvironment().injectAsync(synCtx, sequence);
         } else if (sequenceRef != null) {
-            SequenceMediator refSequence = (SequenceMediator) synCtx.getConfiguration().getSequence(sequenceRef);
+            SequenceMediator refSequence = (SequenceMediator) synCtx.getSequence(sequenceRef);
             if (refSequence != null) {
                 synCtx.getEnvironment().injectAsync(synCtx, refSequence);
             }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/util/MessageHelper.java
Wed Nov 14 23:05:02 2007
@@ -48,6 +48,10 @@
         axis2MC.setAxis2MessageContext(
             cloneAxis2MessageContext(((Axis2MessageContext) synCtx).getAxis2MessageContext()));
 
+        newCtx.setConfiguration(synCtx.getConfiguration());
+        newCtx.setEnvironment(synCtx.getEnvironment());
+        newCtx.setContextEntries(synCtx.getContextEntries());
+
         // set the parent corelation details to the cloned MC -
         //                              for the use of aggregation like tasks
         newCtx.setProperty(EIPConstants.AGGREGATE_CORELATION, synCtx.getMessageID());

Modified: webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/TestMessageContext.java
Wed Nov 14 23:05:02 2007
@@ -70,6 +70,14 @@
         synEnv = se;
     }
 
+    public Map getContextEntries() {
+        return localEntries;
+    }
+
+    public void setContextEntries(Map entries) {
+        this.localEntries = entries;
+    }
+
     public Object getProperty(String key) {
         return properties.get(key);
     }

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
(original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMessageContext.java
Wed Nov 14 23:05:02 2007
@@ -21,6 +21,7 @@
 
 import java.util.Set;
 import java.util.Stack;
+import java.util.Map;
 
 import javax.script.ScriptException;
 
@@ -121,6 +122,14 @@
 
     public void setEnvironment(SynapseEnvironment se) {
         mc.setEnvironment(se);
+    }
+
+    public Map getContextEntries() {
+        return mc.getContextEntries();
+    }
+
+    public void setContextEntries(Map entries) {
+        mc.setContextEntries(entries);
     }
 
     public Object getProperty(String key) {

Modified: webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/TestMessageContext.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/TestMessageContext.java?rev=595227&r1=595226&r2=595227&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/TestMessageContext.java
(original)
+++ webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/TestMessageContext.java
Wed Nov 14 23:05:02 2007
@@ -65,6 +65,14 @@
     public void setEnvironment(SynapseEnvironment se) {
     }
 
+    public Map getContextEntries() {
+        return localEntries;
+    }
+
+    public void setContextEntries(Map entries) {
+        this.localEntries = entries;
+    }
+
     public Object getProperty(String key) {
         return properties.get(key);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message