This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit edce21d041dbb4e0644d007fceea50bcfc93b867
Author: Guillaume Nodet <[email protected]>
AuthorDate: Wed Mar 11 11:11:50 2020 +0100

    Remove reference to the RouteDefinition in ErrorHandlerReifier
---
 .../java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java   | 2 +-
 .../java/org/apache/camel/spring/spi/SpringTransactionPolicy.java     | 2 +-
 .../org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java    | 4 +---
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
 
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
index 74ecaa3..5a2ed4e 100644
--- 
a/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
+++ 
b/components/camel-cdi/src/main/java/org/apache/camel/cdi/transaction/JtaTransactionPolicy.java
@@ -116,7 +116,7 @@ public abstract class JtaTransactionPolicy implements 
TransactedPolicy {
         answer = createTransactionErrorHandler(route, processor, txBuilder);
 
         // set the route to use our transacted error handler builder
-        routeDefinition.setErrorHandlerFactory(txBuilder);
+        route.setErrorHandlerFactory(txBuilder);
 
         // return with wrapped transacted error handler
         return answer;
diff --git 
a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
 
b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
index 2e3ba76..e7e3e4f 100644
--- 
a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
+++ 
b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
@@ -109,7 +109,7 @@ public class SpringTransactionPolicy implements 
TransactedPolicy {
             answer = createTransactionErrorHandler(route, processor, 
txBuilder);
 
             // set the route to use our transacted error handler builder
-            routeDefinition.setErrorHandlerFactory(txBuilder);
+            route.setErrorHandlerFactory(txBuilder);
         }
 
         // return with wrapped transacted error handler
diff --git 
a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
 
b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
index 25da846..5cd85b3 100644
--- 
a/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
+++ 
b/core/camel-core-engine/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
@@ -186,9 +186,7 @@ public abstract class ErrorHandlerReifier<T extends 
ErrorHandlerBuilderSupport>
         // so we should use that one
         if (!isErrorHandlerFactoryConfigured(ref)) {
             // see if there has been configured a error handler builder on the 
route
-            // TODO: Avoid using RouteDefinition - tests should pass: 
https://issues.apache.org/jira/browse/CAMEL-13984
-            RouteDefinition def = (RouteDefinition) route.getRoute();
-            answer = def.getErrorHandlerFactory();
+            answer = route.getErrorHandlerFactory();
             // check if its also a ref with no error handler configuration 
like me
             if (answer instanceof ErrorHandlerBuilderRef) {
                 ErrorHandlerBuilderRef other = (ErrorHandlerBuilderRef)answer;

Reply via email to