完善 Nacos 配置生效条件注解.

pull/117/head
chen.ma 3 years ago
parent 1572032929
commit 32c1bf5a56

@ -42,7 +42,9 @@ public class DynamicThreadPoolCoreAutoConfiguration {
private final BootstrapCoreProperties bootstrapCoreProperties; private final BootstrapCoreProperties bootstrapCoreProperties;
private static final String NACOS_KEY = "com.alibaba.cloud.nacos.NacosConfigManager"; private static final String NACOS_CONFIG_MANAGER_KEY = "com.alibaba.cloud.nacos.NacosConfigManager";
private static final String NACOS_CONFIG_KEY = "com.alibaba.nacos.api.config";
@Bean @Bean
@Order(Ordered.HIGHEST_PRECEDENCE) @Order(Ordered.HIGHEST_PRECEDENCE)
@ -92,7 +94,8 @@ public class DynamicThreadPoolCoreAutoConfiguration {
} }
@Bean @Bean
@ConditionalOnMissingClass(NACOS_KEY) @ConditionalOnClass(name = NACOS_CONFIG_KEY)
@ConditionalOnMissingClass(NACOS_CONFIG_MANAGER_KEY)
public NacosRefresherHandler nacosRefresherHandler(ConfigService configService, public NacosRefresherHandler nacosRefresherHandler(ConfigService configService,
ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler, ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
ConfigParserHandler configParserHandler, ConfigParserHandler configParserHandler,
@ -101,7 +104,7 @@ public class DynamicThreadPoolCoreAutoConfiguration {
} }
@Bean @Bean
@ConditionalOnClass(name = NACOS_KEY) @ConditionalOnClass(name = NACOS_CONFIG_MANAGER_KEY)
public NacosCloudRefresherHandler nacosCloudRefresherHandler(NacosConfigManager nacosConfigManager, public NacosCloudRefresherHandler nacosCloudRefresherHandler(NacosConfigManager nacosConfigManager,
ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler, ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
ConfigParserHandler configParserHandler, ConfigParserHandler configParserHandler,

Loading…
Cancel
Save