Author: chathura_ce
Date: Fri May 25 00:01:59 2007
New Revision: 541571

URL: http://svn.apache.org/viewvc?view=rev&rev=541571
Log:
Made IndirectEndpoint to propagate errors to the fault stack as in all other 
endpoints.

Modified:
    
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/IndirectEndpoint.java

Modified: 
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/IndirectEndpoint.java
URL: 
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/IndirectEndpoint.java?view=diff&rev=541571&r1=541570&r2=541571
==============================================================================
--- 
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/IndirectEndpoint.java
 (original)
+++ 
webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/endpoints/IndirectEndpoint.java
 Fri May 25 00:01:59 2007
@@ -21,6 +21,7 @@
 
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.SynapseException;
+import org.apache.synapse.FaultHandler;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -56,7 +57,17 @@
         if (endpoint.isActive(synMessageContext)) {
             endpoint.send(synMessageContext);
         } else {
-            parentEndpoint.onChildEndpointFail(this, synMessageContext);
+
+            // if this is a child of some other endpoint, inform parent about 
the failure.
+            // if not, inform to the next fault handler.
+            if (parentEndpoint != null) {
+                parentEndpoint.onChildEndpointFail(this, synMessageContext);
+            } else {
+                Object o = synMessageContext.getFaultStack().pop();
+                if (o != null) {
+                    ((FaultHandler) o).handleFault(synMessageContext);
+                }
+            }
         }
     }
 
@@ -114,8 +125,18 @@
         this.parentEndpoint = parentEndpoint;
     }
 
-    public void onChildEndpointFail(Endpoint endpoint, MessageContext 
synMessageContext) {
-        parentEndpoint.onChildEndpointFail(this, synMessageContext);
+    public void onChildEndpointFail(Endpoint endpoint, MessageContext 
synMessageContext) {        
+
+        // if this is a child of some other endpoint, inform parent about the 
failure.
+        // if not, inform to the next fault handler.
+        if (parentEndpoint != null) {
+            parentEndpoint.onChildEndpointFail(this, synMessageContext);
+        } else {
+            Object o = synMessageContext.getFaultStack().pop();
+            if (o != null) {
+                ((FaultHandler) o).handleFault(synMessageContext);
+            }
+        }
     }
 
     private void handleException(String msg) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to