容器后处理器后处理容器自己。必须实现BeanFactoryPostProcessor接口,该接口中有以下方法:ide
postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) : 后处理容器,对Spring容器进行自定义扩展。post
Spring已提供以下几个经常使用的容器后处理器:spa
名称 | 描述 |
PropertyPlaceholderConfigurer | 属性占位符配置器 |
PropertyOverrideConfigurer | 重写占位符配置器 |
CustomAutowireConfigurer | 自定义自动装配的配置器 |
CustomScopeConfigurer | 自定义做用域的配置器 |
若是有须要,程序能够配置多个容器后处理器,多个容器后处理器可设置order属性来控制容器后处理器的执行次序。接口