class PostProcessorRegistrationDelegate {
public static void invokeBeanFactoryPostProcessors(
ConfigurableListableBeanFactory beanFactory, List<BeanFactoryPostProcessor> beanFactoryPostProcessors) {
// Invoke BeanDefinitionRegistryPostProcessors first, if any.
Set<String> processedBeans = new HashSet<String>();
// 符合条件的有熟知的DefaultListableBeanFactory
if (beanFactory instanceof BeanDefinitionRegistry) {
// 省略
}
else {
// 从原英文注释可以看出,这里是处理ApplicationContext的
// Invoke factory processors registered with the context instance.
invokeBeanFactoryPostProcessors(beanFactoryPostProcessors, beanFactory);
}
}
}

DefaultListableBeanFactory下面只有一个:

没有看到ClassPathXmlApplicationContext
Spring 5.2.9版本与4.3.18版本在此处一个不同的地方:


网友评论