Consistently accept "taskExecutor" bean of type Executor (as stated in @EnableAsync's javadoc)

Issue: SPR-15566
This commit is contained in:
Juergen Hoeller
2017-05-25 23:37:02 +02:00
parent 0287a74d69
commit 3cc94ae8b5
3 changed files with 46 additions and 5 deletions

View File

@@ -219,6 +219,7 @@ public class ScheduledAnnotationBeanPostProcessor
this.registrar.setTaskScheduler(resolveSchedulerBean(TaskScheduler.class, false));
}
catch (NoUniqueBeanDefinitionException ex) {
logger.debug("Could not find unique TaskScheduler bean", ex);
try {
this.registrar.setTaskScheduler(resolveSchedulerBean(TaskScheduler.class, true));
}
@@ -239,6 +240,7 @@ public class ScheduledAnnotationBeanPostProcessor
this.registrar.setScheduler(resolveSchedulerBean(ScheduledExecutorService.class, false));
}
catch (NoUniqueBeanDefinitionException ex2) {
logger.debug("Could not find unique ScheduledExecutorService bean", ex2);
try {
this.registrar.setScheduler(resolveSchedulerBean(ScheduledExecutorService.class, true));
}