容器後處理器後處理容器自己。必須實現BeanFactoryPostProcessor接口,該接口中有以下方法:ide
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) : 後處理容器,對Spring容器進行自定義擴展。post
Spring已提供以下幾個經常使用的容器後處理器:spa
名稱 | 描述 |
PropertyPlaceholderConfigurer | 屬性佔位符配置器 |
PropertyOverrideConfigurer | 重寫佔位符配置器 |
CustomAutowireConfigurer | 自定義自動裝配的配置器 |
CustomScopeConfigurer | 自定義做用域的配置器 |
若是有須要,程序能夠配置多個容器後處理器,多個容器後處理器可設置order屬性來控制容器後處理器的執行次序。接口