ImportAwareBeanPostProcessor registered with ROLE_INFRASTRUCTURE

This commit is contained in:
Juergen Hoeller 2012-09-24 11:26:47 +02:00
parent aa4d9c48ab
commit dc4e0683ae
1 changed files with 5 additions and 2 deletions

View File

@ -205,8 +205,10 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
* Derive further bean definitions from the configuration classes in the registry.
*/
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) {
registry.registerBeanDefinition(IMPORT_AWARE_PROCESSOR_BEAN_NAME,
new RootBeanDefinition(ImportAwareBeanPostProcessor.class));
RootBeanDefinition iabpp = new RootBeanDefinition(ImportAwareBeanPostProcessor.class);
iabpp.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
registry.registerBeanDefinition(IMPORT_AWARE_PROCESSOR_BEAN_NAME, iabpp);
int registryId = System.identityHashCode(registry);
if (this.registriesPostProcessed.contains(registryId)) {
throw new IllegalStateException(
@ -217,6 +219,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
"postProcessBeanFactory already called for this post-processor against " + registry);
}
this.registriesPostProcessed.add(registryId);
processConfigBeanDefinitions(registry);
}