CAMEL-9069: Added onExceptionOuccrredProcessor to error handler to allow a processor to be invoked right after an exception was thrown.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/391e34f7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/391e34f7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/391e34f7 Branch: refs/heads/master Commit: 391e34f7b259df916721df47f5ee9adb7658554d Parents: 44e8556 Author: Claus Ibsen <davscl...@apache.org> Authored: Sun Jan 31 10:45:34 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Jan 31 10:45:34 2016 +0100 ---------------------------------------------------------------------- .../java/org/apache/camel/processor/DefaultErrorHandler.java | 6 +++--- .../OnExceptionOccurredProcessorOnExceptionTest.java | 6 +++--- .../onexception/OnExceptionOccurredProcessorTest.java | 6 +++--- .../camel/spring/handler/ErrorHandlerDefinitionParser.java | 4 +++- .../camel/spring/spi/TransactionErrorHandlerBuilder.java | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/391e34f7/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java b/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java index a8fa1e9..7f94887 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java +++ b/camel-core/src/main/java/org/apache/camel/processor/DefaultErrorHandler.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * <p> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p> + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. http://git-wip-us.apache.org/repos/asf/camel/blob/391e34f7/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorOnExceptionTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorOnExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorOnExceptionTest.java index 838f8a3..8bdd7d4 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorOnExceptionTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorOnExceptionTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * <p> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p> + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. http://git-wip-us.apache.org/repos/asf/camel/blob/391e34f7/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorTest.java b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorTest.java index 77d959f..c1ff343 100644 --- a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorTest.java +++ b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionOccurredProcessorTest.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * <p> - * http://www.apache.org/licenses/LICENSE-2.0 - * <p> + * + * http://www.apache.org/licenses/LICENSE-2.0 + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. http://git-wip-us.apache.org/repos/asf/camel/blob/391e34f7/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java index 0dbc53d..1014e61 100644 --- a/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java +++ b/components/camel-spring/src/main/java/org/apache/camel/spring/handler/ErrorHandlerDefinitionParser.java @@ -58,7 +58,8 @@ public class ErrorHandlerDefinitionParser extends BeanDefinitionParser { if (attributeName.equals("xmlns") || attributeName.startsWith("xmlns:")) { return false; } - return !attributeName.equals("type") + // CHECKSTYLE:OFF + return !attributeName.equals("type") && !attributeName.equals("onRedeliveryRef") && !attributeName.equals("onRetryWhileRef") && !attributeName.equals("onPrepareFailureRef") @@ -66,6 +67,7 @@ public class ErrorHandlerDefinitionParser extends BeanDefinitionParser { && !attributeName.equals("redeliveryPolicyRef") && !attributeName.equals("transactionTemplateRef") && !attributeName.equals("transactionManagerRef"); + // CHECKSTYLE:ON } @Override http://git-wip-us.apache.org/repos/asf/camel/blob/391e34f7/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerBuilder.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerBuilder.java b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerBuilder.java index 2e35574..b05ed15 100644 --- a/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerBuilder.java +++ b/components/camel-spring/src/main/java/org/apache/camel/spring/spi/TransactionErrorHandlerBuilder.java @@ -80,7 +80,7 @@ public class TransactionErrorHandlerBuilder extends DefaultErrorHandlerBuilder { LOG.trace("No TransactionTemplate found in registry."); } else if (mapTemplate.size() == 1) { transactionTemplate = mapTemplate.values().iterator().next(); - }else { + } else { LOG.debug("Found {} TransactionTemplate in registry. Cannot determine which one to use. " + "Please configure a TransactionTemplate on the TransactionErrorHandlerBuilder", mapTemplate.size()); } @@ -92,7 +92,7 @@ public class TransactionErrorHandlerBuilder extends DefaultErrorHandlerBuilder { LOG.trace("No PlatformTransactionManager found in registry."); } else if (mapManager.size() == 1) { transactionTemplate = new TransactionTemplate(mapManager.values().iterator().next()); - }else { + } else { LOG.debug("Found {} PlatformTransactionManager in registry. Cannot determine which one to use for TransactionTemplate. " + "Please configure a TransactionTemplate on the TransactionErrorHandlerBuilder", mapManager.size()); }