AbstractApplicationContext类refresh()方法中的第四个调用方法postProcessBeanFactory(beanFactory),允许容器的子类去注册postProcessor ,钩子方法。
postProcessBeanFactory方法的接口声明在AbstractApplicationContext类中:
/**
* 在标准初始化后修改应用程序上下文的内部bean工厂。
* 所有bean定义都将被加载,但是没有bean会被实例化。
* 这允许在某些应用上下文实现中注册特殊的BeanPostProcessors等。
*
* Modify the application context's internal bean factory after its standard
* initialization. All bean definitions will have been loaded, but no beans
* will have been instantiated yet. This allows for registering special
* BeanPostProcessors etc in certain ApplicationContext implementations.
* @param beanFactory the bean factory used by the application context 应用环境下的Bean工厂
*/
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
}