You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/05/17 10:00:03 UTC
svn commit: r775597 -
/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java
Author: davsclaus
Date: Sun May 17 08:00:02 2009
New Revision: 775597
URL: http://svn.apache.org/viewvc?rev=775597&view=rev
Log:
CAMEL-1620: Improved failover loadbalancer. Handling multiple exceptions and being able to look in hiearachy.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java?rev=775597&r1=775596&r2=775597&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/FailOverLoadBalancer.java Sun May 17 08:00:02 2009
@@ -16,8 +16,6 @@
*/
package org.apache.camel.processor.loadbalancer;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.apache.camel.Exchange;
@@ -59,13 +57,9 @@
}
for (Class exception : exceptions) {
- // use exception iterator to walk the hieracy tree as the exception is possibly wrapped
- Iterator<Throwable> it = ObjectHelper.createExceptionIterator(exchange.getException());
- while (it.hasNext()) {
- Throwable e = it.next();
- if (exception.isInstance(e)) {
- return true;
- }
+ // will look in exception hierarchy
+ if (exchange.getException(exception) != null) {
+ return true;
}
}
}