AbstractApplicationContext类refresh()方法中的第四个调用方法postProcessBeanFactory(beanFactory),允许容器的子类去注册postProcessor ,钩子方法。
    postProcessBeanFactory方法的接口声明在AbstractApplicationContext类中:

    1. /**
    2. * 在标准初始化后修改应用程序上下文的内部bean工厂。
    3. * 所有bean定义都将被加载,但是没有bean会被实例化。
    4. * 这允许在某些应用上下文实现中注册特殊的BeanPostProcessors等。
    5. *
    6. * Modify the application context's internal bean factory after its standard
    7. * initialization. All bean definitions will have been loaded, but no beans
    8. * will have been instantiated yet. This allows for registering special
    9. * BeanPostProcessors etc in certain ApplicationContext implementations.
    10. * @param beanFactory the bean factory used by the application context 应用环境下的Bean工厂
    11. */
    12. protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
    13. }