@Scheduled reliably applies after other post-processors and shuts down before TaskScheduler

Issue: SPR-14692
Issue: SPR-15067
This commit is contained in:
Juergen Hoeller
2016-12-29 22:35:10 +01:00
parent a30ceafc2c
commit edc62be231
5 changed files with 122 additions and 26 deletions

View File

@@ -34,9 +34,10 @@ import org.springframework.beans.factory.BeanInitializationException;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.config.EmbeddedValueResolver;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.MethodIntrospector;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotatedElementUtils;
@@ -81,7 +82,7 @@ import org.springframework.util.StringValueResolver;
* @see MethodJmsListenerEndpoint
*/
public class JmsListenerAnnotationBeanPostProcessor
implements BeanPostProcessor, Ordered, BeanFactoryAware, SmartInitializingSingleton {
implements MergedBeanDefinitionPostProcessor, Ordered, BeanFactoryAware, SmartInitializingSingleton {
/**
* The bean name of the default {@link JmsListenerContainerFactory}.
@@ -192,6 +193,10 @@ public class JmsListenerAnnotationBeanPostProcessor
}
@Override
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;