Search in sources :

Example 1 with DisconfMgrBean

use of com.baidu.disconf.client.DisconfMgrBean in project disconf-spring-boot-starter by xjzrc.

the class DisconfAutoConfiguration method disconfMgrBean.

/**
 * 设置扫描包路径
 * 初始化DisconfMgrBean
 *
 * @return DisconfMgrBean
 */
@Bean(destroyMethod = "destroy")
public DisconfMgrBean disconfMgrBean() {
    DisconfMgrBean disconfMgrBean = new DisconfMgrBean();
    if (StringUtils.isBlank(disconfProperties.getScanPackage())) {
        LOGGER.error("disconf scan package is null!, please set the value in application.properties. (spring.disconf.scan-package=com.zen)");
        throw new RuntimeException("disconf scan package is null!, please set the value in application.properties. (spring.disconf.scan-package=com.zen)");
    }
    disconfMgrBean.setScanPackage(disconfProperties.getScanPackage());
    return disconfMgrBean;
}
Also used : DisconfMgrBean(com.baidu.disconf.client.DisconfMgrBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) DisconfMgrBean(com.baidu.disconf.client.DisconfMgrBean) ReloadablePropertiesFactoryBean(com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

DisconfMgrBean (com.baidu.disconf.client.DisconfMgrBean)1 ReloadablePropertiesFactoryBean (com.baidu.disconf.client.addons.properties.ReloadablePropertiesFactoryBean)1 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)1 Bean (org.springframework.context.annotation.Bean)1