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

This commit is contained in:
Chris Beams
2010-05-17 16:21:36 +00:00
parent 0b8140b50d
commit 57a503b274
2 changed files with 63 additions and 5 deletions

View File

@@ -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.