1.後置處理器的postProcessorBeforeInitailization方法是在bean實例化,依賴注入以後及自定義初始化方法(例如:配置文件中bean標籤添加init-method屬性指定Java類中初始化方法、@PostConstruct註解指定初始化方法,Java類實現InitailztingBean接口)以前調用
2.後置處理器的postProcessorAfterInitailization方法是在bean實例化、依賴注入及自定義初始化方法以後調用
BeanFactoryPostProcessor
Spring IoC容器容許BeanFactoryPostProcessor在容器實例化任何bean以前讀取bean的定義(配置元數據),並能夠修改它。同時能夠定義多個BeanFactoryPostProcessor,經過設置'order'屬性來肯定各個BeanFactoryPostProcessor執行順序。
BeanDefinitionRegistryPostProcessor