use of com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer in project disconf-spring-boot-starter by xjzrc.
the class DisconfAutoConfiguration method disconfReloadingPropertyPlaceholderConfigurer.
/**
* 当配置文件改变,会自动reload到系统
*
* @param factoryBean 会自动reload配置工厂
* @return ReloadingPropertyPlaceholderConfigurer
* @throws IOException IOException
*/
@Bean
@ConditionalOnBean(name = "disconfReloadablePropertiesFactoryBean")
public ReloadingPropertyPlaceholderConfigurer disconfReloadingPropertyPlaceholderConfigurer(@Qualifier("disconfReloadablePropertiesFactoryBean") ReloadablePropertiesFactoryBean factoryBean) throws IOException {
ReloadingPropertyPlaceholderConfigurer configurer = new ReloadingPropertyPlaceholderConfigurer();
configurer.setOrder(1);
configurer.setIgnoreResourceNotFound(true);
configurer.setIgnoreUnresolvablePlaceholders(true);
configurer.setProperties(factoryBean.getObject());
addPropertiesPropertySource("disconfReloadableProperties", factoryBean.getObject());
return configurer;
}
Aggregations