Created
July 30, 2011 12:55
-
-
Save nschlimm/1115494 to your computer and use it in GitHub Desktop.
DecoratorBeanFactoryPostProcessor main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { | |
Map<String, Class> decorators = decoratorResolutionStrategy.getRegisteredDecorators(beanFactory); | |
List<QualifiedDecoratorChain> chains = buildQualifiedDecoratorChains(beanFactory, decorators); | |
registerAutowireCandidateResolver(beanFactory, chains); | |
registerDecoratorMetadataBean(beanFactory, chains); | |
if (PROCESSOR.equals(getMode())) { | |
((DefaultListableBeanFactory) beanFactory).registerBeanDefinition(DECORATOR_POSTPROCESSOR_NAME, BeanDefinitionBuilder.rootBeanDefinition(DecoratorAwareBeanPostProcessor.class).getBeanDefinition()); | |
if (beanFactory.getBeanNamesForType(DecoratorAwareBeanPostProcessor.class) == null) { | |
throw new DecoratorAwareBeanFactoryPostProcessorException("Mode 'resolver' requires DecoratorAwareBeanPostProcessor registered!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment