use of com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean in project disconf-spring-boot-starter by xjzrc.
the class DisconfAutoConfiguration method disconfPropertyPlaceholderConfigurer.
/**
* 当配置文件改变,不会自动reload到系统
*
* @param factoryBean 不会自动reload配置工厂
* @return PropertyPlaceholderConfigurer
* @throws IOException IOException
*/
@Bean
@ConditionalOnBean(name = "disconfUnReloadablePropertiesFactoryBean")
public PropertyPlaceholderConfigurer disconfPropertyPlaceholderConfigurer(@Qualifier("disconfUnReloadablePropertiesFactoryBean") ReloadablePropertiesFactoryBean factoryBean) throws IOException {
PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
configurer.setOrder(1);
configurer.setIgnoreResourceNotFound(true);
configurer.setIgnoreUnresolvablePlaceholders(true);
configurer.setProperties(factoryBean.getObject());
addPropertiesPropertySource("disconfUnReloadableProperties", factoryBean.getObject());
return configurer;
}
use of com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean in project disconf-spring-boot-starter by xjzrc.
the class DisconfAutoConfiguration method disconfUnReloadablePropertiesFactoryBean.
/**
* 使用托管方式的disconf配置
*
* @return ReloadablePropertiesFactoryBean
*/
@Bean("disconfUnReloadablePropertiesFactoryBean")
@ConditionalOnExpression("'${spring.disconf.un-reload-files}' != '' and !'${spring.disconf.un-reload-files}'.startsWith('${')")
public ReloadablePropertiesFactoryBean disconfUnReloadablePropertiesFactoryBean() {
ReloadablePropertiesFactoryBean factoryBean = new ReloadablePropertiesFactoryBean();
factoryBean.setLocations(getFileNames(disconfProperties.getUnReloadFiles()));
return factoryBean;
}
use of com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean in project disconf-spring-boot-starter by xjzrc.
the class DisconfAutoConfiguration method disconfReloadablePropertiesFactoryBean.
/**
* 使用托管方式的disconf配置
*
* @return ReloadablePropertiesFactoryBean
*/
@Bean("disconfReloadablePropertiesFactoryBean")
@ConditionalOnExpression("'${spring.disconf.reload-files}' != '' and !'${spring.disconf.reload-files}'.startsWith('${')")
public ReloadablePropertiesFactoryBean disconfReloadablePropertiesFactoryBean() {
ReloadablePropertiesFactoryBean factoryBean = new ReloadablePropertiesFactoryBean();
factoryBean.setLocations(getFileNames(disconfProperties.getReloadFiles()));
return factoryBean;
}
use of com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean 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