From dc4e0683aeccdabfa212d20a5335e81af13cd6d4 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 24 Sep 2012 11:26:47 +0200 Subject: [PATCH] ImportAwareBeanPostProcessor registered with ROLE_INFRASTRUCTURE --- .../annotation/ConfigurationClassPostProcessor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java index 3e07e832464..45e937e7222 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java @@ -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); }