From 68055ba4c9b2db737f9f4ec013d78ec0891b4dda Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 13 May 2010 22:13:29 +0000 Subject: [PATCH] AsyncAnnotationBeanPostProcessor consistently adds @Async processing as first Advisor in the chain (SPR-7147) --- .../annotation/AsyncAnnotationBeanPostProcessor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessor.java b/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessor.java index 6eacaf0a0a..d363a538ab 100644 --- a/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessor.java +++ b/org.springframework.context/src/main/java/org/springframework/scheduling/annotation/AsyncAnnotationBeanPostProcessor.java @@ -89,10 +89,10 @@ public class AsyncAnnotationBeanPostProcessor extends ProxyConfig } public void afterPropertiesSet() { - this.asyncAnnotationAdvisor = (this.executor != null) ? - new AsyncAnnotationAdvisor(this.executor) : new AsyncAnnotationAdvisor(); + this.asyncAnnotationAdvisor = (this.executor != null ? + new AsyncAnnotationAdvisor(this.executor) : new AsyncAnnotationAdvisor()); if (this.asyncAnnotationType != null) { - this.asyncAnnotationAdvisor.setAsyncAnnotationType(asyncAnnotationType); + this.asyncAnnotationAdvisor.setAsyncAnnotationType(this.asyncAnnotationType); } } @@ -115,7 +115,7 @@ public class AsyncAnnotationBeanPostProcessor extends ProxyConfig Class targetClass = AopUtils.getTargetClass(bean); if (AopUtils.canApply(this.asyncAnnotationAdvisor, targetClass)) { if (bean instanceof Advised) { - ((Advised) bean).addAdvisor(this.asyncAnnotationAdvisor); + ((Advised) bean).addAdvisor(0, this.asyncAnnotationAdvisor); return bean; } else {