java类org.springframework.beans.factory.config.PropertyResourceConfigurer的实例源码

ContextUtils.java 文件源码 项目:spring-component-framework 阅读 30 收藏 0 点赞 0 评论 0
/**
 * 继承上级上下文中的属性配置器
 *
 * @param inheriting  上级上下文
 * @param context 当前上下文
 */
public static void inheritParentProperties(ApplicationContext inheriting,
                                           GenericApplicationContext context) {
    if (!(inheriting instanceof AbstractApplicationContext)) return;
    List<BeanFactoryPostProcessor> processors =
            ((AbstractApplicationContext) inheriting).getBeanFactoryPostProcessors();
    for (BeanFactoryPostProcessor processor : processors) {
        if (processor instanceof PropertyResourceConfigurer)
            context.addBeanFactoryPostProcessor(processor);
    }
}
IntegrationTestConfiguration.java 文件源码 项目:cloudbreak 阅读 27 收藏 0 点赞 0 评论 0
@Bean
public static PropertyResourceConfigurer propertySourcesPlaceholderConfigurer() {
    return new PropertySourcesPlaceholderConfigurer();
}
TestConfig.java 文件源码 项目:cloudbreak 阅读 23 收藏 0 点赞 0 评论 0
@Bean
public static PropertyResourceConfigurer propertyResourceConfigurer() {
    return new PropertySourcesPlaceholderConfigurer();
}


问题


面经


文章

微信
公众号

扫码关注公众号