Post-processors consistently ignore ScopedObject/AopInfrastructureBean

JmsListenerAnnotationBeanPostProcessor also ignores JmsListenerContainerFactory and JmsListenerEndpointRegistry, avoiding unnecessary annotation introspection on framework classes.

Issue: SPR-17166
Issue: SPR-16933
This commit is contained in:
Juergen Hoeller
2018-08-12 11:47:28 +02:00
parent 8d08935c49
commit c4a7567a5e
3 changed files with 52 additions and 39 deletions

View File

@@ -350,7 +350,7 @@ public class ScheduledAnnotationBeanPostProcessor
if (annotatedMethods.isEmpty()) {
this.nonAnnotatedClasses.add(targetClass);
if (logger.isTraceEnabled()) {
logger.trace("No @Scheduled annotations found on bean class: " + bean.getClass());
logger.trace("No @Scheduled annotations found on bean class: " + targetClass);
}
}
else {
@@ -507,9 +507,7 @@ public class ScheduledAnnotationBeanPostProcessor
* @see ScheduledMethodRunnable#ScheduledMethodRunnable(Object, Method)
*/
protected Runnable createRunnable(Object target, Method method) {
Assert.isTrue(method.getParameterCount() == 0,
"Only no-arg methods may be annotated with @Scheduled");
Assert.isTrue(method.getParameterCount() == 0, "Only no-arg methods may be annotated with @Scheduled");
Method invocableMethod = AopUtils.selectInvocableMethod(method, target.getClass());
return new ScheduledMethodRunnable(target, invocableMethod);
}