Avoid scoped destruction callbacks in case of no post-processor actually applying
Issue: SPR-13744
This commit is contained in:
@@ -347,7 +347,8 @@ class PostProcessorRegistrationDelegate {
|
||||
* BeanPostProcessor that detects beans which implement the ApplicationListener interface.
|
||||
* This catches beans that can't reliably be detected by getBeanNamesForType.
|
||||
*/
|
||||
private static class ApplicationListenerDetector implements MergedBeanDefinitionPostProcessor, DestructionAwareBeanPostProcessor {
|
||||
private static class ApplicationListenerDetector
|
||||
implements DestructionAwareBeanPostProcessor, MergedBeanDefinitionPostProcessor {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(ApplicationListenerDetector.class);
|
||||
|
||||
@@ -402,6 +403,11 @@ class PostProcessorRegistrationDelegate {
|
||||
multicaster.removeApplicationListenerBean(beanName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresDestruction(Object bean) {
|
||||
return (bean instanceof ApplicationListener);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user