This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 4ec1d83 CAMEL-14883 CamelBeanPostProcessor implements Ordered
interface provided by Spring (lowest precedence) (#3731)
4ec1d83 is described below
commit 4ec1d838611ff0c6edb78502f97fd6198e9c6e78
Author: Björn Eickvonder <[email protected]>
AuthorDate: Tue Apr 14 06:52:44 2020 +0200
CAMEL-14883 CamelBeanPostProcessor implements Ordered interface provided by
Spring (lowest precedence) (#3731)
This avoids issues e.g. described in
https://github.com/spring-projects/spring-framework/issues/24058 that occur if
a bean post processor does not implement Ordered interface.
---
.../main/java/org/apache/camel/spring/CamelBeanPostProcessor.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git
a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
index 0b5df53..993379b 100644
---
a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
+++
b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
@@ -40,6 +40,7 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
+import org.springframework.core.Ordered;
/**
* Spring specific {@link DefaultCamelBeanPostProcessor} which uses Spring
{@link BeanPostProcessor} to post process beans.
@@ -49,7 +50,7 @@ import org.springframework.context.ApplicationContextAware;
@Metadata(label = "spring,configuration")
@XmlRootElement(name = "beanPostProcessor")
@XmlAccessorType(XmlAccessType.FIELD)
-public class CamelBeanPostProcessor implements
org.apache.camel.spi.CamelBeanPostProcessor, BeanPostProcessor,
ApplicationContextAware {
+public class CamelBeanPostProcessor implements
org.apache.camel.spi.CamelBeanPostProcessor, BeanPostProcessor,
ApplicationContextAware, Ordered {
private static final Logger LOG =
LoggerFactory.getLogger(CamelBeanPostProcessor.class);
@XmlTransient
Set<String> prototypeBeans = new LinkedHashSet<>();
@@ -182,6 +183,11 @@ public class CamelBeanPostProcessor implements
org.apache.camel.spi.CamelBeanPos
}
}
+ @Override
+ public int getOrder() {
+ return LOWEST_PRECEDENCE;
+ }
+
// Properties
//
-------------------------------------------------------------------------