synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject svn commit: r589943 - in /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter: CloneMediator.java IterateMediator.java
Date Tue, 30 Oct 2007 02:38:43 GMT
Author: ruwan
Date: Mon Oct 29 19:38:43 2007
New Revision: 589943

URL: http://svn.apache.org/viewvc?rev=589943&view=rev
Log:
Fixing an issue with Clone and Iterate to stop sending the blank http response when the forked
child messages are executing

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/CloneMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/IterateMediator.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/CloneMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/CloneMediator.java?rev=589943&r1=589942&r2=589943&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/CloneMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/CloneMediator.java
Mon Oct 29 19:38:43 2007
@@ -20,11 +20,14 @@
 package org.apache.synapse.mediators.eip.splitter;
 
 import org.apache.synapse.MessageContext;
+import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.util.MessageHelper;
 import org.apache.synapse.mediators.AbstractMediator;
 import org.apache.synapse.mediators.eip.Target;
 import org.apache.synapse.mediators.eip.EIPConstants;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.context.OperationContext;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -87,6 +90,14 @@
         // finalize tracing and debugging
         if (traceOrDebugOn) {
             traceOrDebug(traceOn, "End : Clone mediator");
+        }
+
+        // if the continuation of the parent message is stopped from here set the RESPONSE_WRITTEN
+        // property to SKIP to skip the blank http response 
+        OperationContext opCtx
+            = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getOperationContext();
+        if (continueParent && opCtx != null) {
+            opCtx.setProperty(Constants.RESPONSE_WRITTEN,"SKIP");
         }
 
         // if continue parent is true mediators after the clone will be called for the further

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/IterateMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/IterateMediator.java?rev=589943&r1=589942&r2=589943&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/IterateMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/eip/splitter/IterateMediator.java
Mon Oct 29 19:38:43 2007
@@ -24,12 +24,15 @@
 import org.apache.synapse.mediators.eip.Target;
 import org.apache.synapse.mediators.eip.EIPConstants;
 import org.apache.synapse.MessageContext;
+import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.util.MessageHelper;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNode;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.context.OperationContext;
 import org.jaxen.JaxenException;
 
 import java.util.List;
@@ -112,9 +115,8 @@
                 }
 
                 // iterate through the list
-                for (Iterator itr = splitElements.iterator(); itr.hasNext();) {
+                for (Object o : splitElements) {
 
-                    Object o = itr.next();
                     // clone the message for the mediation in iteration
                     MessageContext newCtx = MessageHelper.cloneMessageContext(synCtx);
                     // set the messageSequence property for possibal aggreagtions
@@ -147,7 +149,7 @@
                                 "Unable to get the attach path specified by the expression
" +
                                 attachPath, synCtx);
                         }
-                    // if not preserve payload then attach the iteration element to the body
+                        // if not preserve payload then attach the iteration element to the
body
                     } else if (o instanceof OMNode && newEnvelope.getBody() != null)
{
                         newEnvelope.getBody().addChild((OMNode) o);
                     }
@@ -175,6 +177,14 @@
         // finalizing the tracing and logging on the iterate mediator
         if (traceOrDebugOn) {
             traceOrDebug(traceOn, "End : Iterate mediator");
+        }
+
+        // if the continuation of the parent message is stopped from here set the RESPONSE_WRITTEN
+        // property to SKIP to skip the blank http response 
+        OperationContext opCtx
+            = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getOperationContext();
+        if (continueParent && opCtx != null) {
+            opCtx.setProperty(Constants.RESPONSE_WRITTEN,"SKIP");
         }
 
         // whether to continue mediation on the original message



---------------------------------------------------------------------
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