BeanDefinitionRegistryPostProcessors' postProcessBeanDefinitionRegistry() method now gets called before postProcessBeanFactory() (SPR-7167)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3344 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Chris Beams
2010-05-17 16:21:36 +00:00
parent f0544b5aad
commit 50241ca741
2 changed files with 63 additions and 5 deletions
@@ -573,16 +573,16 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
// Invoke BeanDefinitionRegistryPostProcessors first, if any.
if (beanFactory instanceof BeanDefinitionRegistry) {
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
Collection<BeanDefinitionRegistryPostProcessor> registryPostProcessors =
beanFactory.getBeansOfType(BeanDefinitionRegistryPostProcessor.class, true, false).values();
for (BeanDefinitionRegistryPostProcessor postProcessor : registryPostProcessors) {
postProcessor.postProcessBeanFactory(beanFactory);
}
for (BeanFactoryPostProcessor postProcessor : getBeanFactoryPostProcessors()) {
if (postProcessor instanceof BeanDefinitionRegistryPostProcessor) {
((BeanDefinitionRegistryPostProcessor) postProcessor).postProcessBeanDefinitionRegistry(registry);
}
}
Collection<BeanDefinitionRegistryPostProcessor> registryPostProcessors =
beanFactory.getBeansOfType(BeanDefinitionRegistryPostProcessor.class, true, false).values();
for (BeanDefinitionRegistryPostProcessor postProcessor : registryPostProcessors) {
postProcessor.postProcessBeanDefinitionRegistry(registry);
}
}
// Invoke factory processors registered with the context instance.