Author: davsclaus
Date: Sat Feb 11 13:19:06 2012
New Revision: 1243055

URL: http://svn.apache.org/viewvc?rev=1243055&view=rev
Log:
CAMEL-5000: Fixed error handler not called when recipient list has non existing 
endpoint.

Added:
    
camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointErrorHandlerTest.java
      - copied unchanged from r1243052, 
camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointErrorHandlerTest.java
    
camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointIgnoreInvalidEndpointsTest.java
      - copied unchanged from r1243052, 
camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointIgnoreInvalidEndpointsTest.java
Modified:
    camel/branches/camel-2.8.x/   (props changed)
    
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/RecipientList.java
    
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
    
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
    
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
    camel/branches/camel-2.8.x/components/camel-http/   (props changed)

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Feb 11 13:19:06 2012
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.9.x:1227549,1228229,1229567,1234054,1236672,1238942,1240157,1241006,1241489
-/camel/trunk:1226860,1227540,1228223,1229565,1234043,1236667,1238937,1240025,1240950,1240967,1241482
+/camel/branches/camel-2.9.x:1227549,1228229,1229567,1234054,1236672,1238942,1240157,1241006,1241489,1243052
+/camel/trunk:1226860,1227540,1228223,1229565,1234043,1236667,1238937,1240025,1240950,1240967,1241482,1243046

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/RecipientList.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/RecipientList.java?rev=1243055&r1=1243054&r2=1243055&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/RecipientList.java
 (original)
+++ 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/RecipientList.java
 Sat Feb 11 13:19:06 2012
@@ -53,5 +53,6 @@ public @interface RecipientList {
     String executorServiceRef() default "";
     long timeout() default 0;
     String onPrepareRef() default "";
+    @Deprecated
     boolean shareUnitOfWork() default false;
 }
\ No newline at end of file

Modified: 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=1243055&r1=1243054&r2=1243055&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
 (original)
+++ 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
 Sat Feb 11 13:19:06 2012
@@ -259,17 +259,7 @@ public abstract class ProcessorDefinitio
                 // only wrap the parent (not the children of the multicast)
                 wrapChannelInErrorHandler(channel, routeContext);
             } else {
-                log.trace("{} is part of multicast/recipientList which have 
special error handling so no error handler is applied", defn);
-            }
-        } else if (defn instanceof RecipientListDefinition) {
-            // do not use error handler for recipient list as it offers fine 
grained error handlers for its outputs
-            // however if share unit of work is enabled, we need to wrap an 
error handler on the recipient list parent
-            RecipientListDefinition def = (RecipientListDefinition) defn;
-            if (def.isShareUnitOfWork()) {
-                // note a recipient list cannot have children so no need for a 
child == null check
-                wrapChannelInErrorHandler(channel, routeContext);
-            } else {
-                log.trace("{} is part of multicast/recipientList which have 
special error handling so no error handler is applied", defn);
+                log.trace("{} is part of multicast which have special error 
handling so no error handler is applied", defn);
             }
         } else {
             // use error handler by default or if configured to do so

Modified: 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java?rev=1243055&r1=1243054&r2=1243055&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
 (original)
+++ 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
 Sat Feb 11 13:19:06 2012
@@ -70,6 +70,7 @@ public class RecipientListDefinition<Typ
     @XmlTransient
     private Processor onPrepare;
     @XmlAttribute
+    @Deprecated
     private Boolean shareUnitOfWork;
 
     public RecipientListDefinition() {
@@ -302,6 +303,7 @@ public class RecipientListDefinition<Typ
      * @return the builder.
      * @see org.apache.camel.spi.SubUnitOfWork
      */
+    @Deprecated
     public RecipientListDefinition<Type> shareUnitOfWork() {
         setShareUnitOfWork(true);
         return this;
@@ -422,14 +424,17 @@ public class RecipientListDefinition<Typ
         this.onPrepare = onPrepare;
     }
 
+    @Deprecated
     public Boolean getShareUnitOfWork() {
         return shareUnitOfWork;
     }
 
+    @Deprecated
     public void setShareUnitOfWork(Boolean shareUnitOfWork) {
         this.shareUnitOfWork = shareUnitOfWork;
     }
 
+    @Deprecated
     public boolean isShareUnitOfWork() {
         return shareUnitOfWork != null && shareUnitOfWork;
     }

Modified: 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java?rev=1243055&r1=1243054&r2=1243055&view=diff
==============================================================================
--- 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
 (original)
+++ 
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
 Sat Feb 11 13:19:06 2012
@@ -733,14 +733,14 @@ public class MulticastProcessor extends 
     protected void doDone(Exchange original, Exchange subExchange, 
AsyncCallback callback, boolean doneSync, boolean exhaust) {
         // cleanup any per exchange aggregation strategy
         removeAggregationStrategyFromExchange(original);
-        if (original.getException() != null) {
+        if (original.getException() != null || subExchange != null && 
subExchange.getException() != null) {
             // multicast uses error handling on its output processors and they 
have tried to redeliver
             // so we shall signal back to the other error handlers that we are 
exhausted and they should not
             // also try to redeliver as we will then do that twice
             original.setProperty(Exchange.REDELIVERY_EXHAUSTED, exhaust);
         }
         if (subExchange != null) {
-            // and copy the current result to original so it will contain this 
exception
+            // and copy the current result to original so it will contain this 
result of this eip
             ExchangeHelper.copyResults(original, subExchange);
         }
         callback.done(doneSync);

Propchange: camel/branches/camel-2.8.x/components/camel-http/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Feb 11 13:19:06 2012
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.9.x/components/camel-http:1234054,1241006,1241489
+/camel/branches/camel-2.9.x/components/camel-http:1234054,1241006,1241489,1243052
 /camel/trunk/components/camel-http:1226860,1228223,1234043


Reply via email to