From 16097e7a268ebafe3d6fa5b603a473a9823e2df3 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Sat, 27 Aug 2022 13:33:49 +0800 Subject: [PATCH] Change configuration property naming --- ...es.java => BootstrapConfigProperties.java} | 4 ++-- .../config/ConfigHandlerConfiguration.java | 12 +++++----- ...ynamicThreadPoolCoreAutoConfiguration.java | 16 ++++++------- .../DynamicThreadPoolMonitorExecutor.java | 4 ++-- .../notify/CoreNotifyConfigBuilder.java | 16 ++++++------- .../AbstractCoreThreadPoolDynamicRefresh.java | 14 +++++------ .../refresher/ApolloRefresherHandler.java | 8 +++---- .../BootstrapCorePropertiesBinderAdapt.java | 24 +++++++++---------- .../refresher/NacosCloudRefresherHandler.java | 2 +- .../refresher/NacosRefresherHandler.java | 8 +++---- .../refresher/ZookeeperRefresherHandler.java | 4 ++-- .../AdapterExecutorsRefreshListener.java | 8 +++---- .../DynamicThreadPoolRefreshListener.java | 12 +++++----- ... => Hippo4jConfigDynamicRefreshEvent.java} | 12 +++++----- ...ippo4jConfigDynamicRefreshEventOrder.java} | 4 ++-- .../event/PlatformsRefreshListener.java | 12 +++++----- .../event/WebExecutorRefreshListener.java | 12 +++++----- .../DynamicThreadPoolAdapterRegister.java | 6 ++--- .../DynamicThreadPoolPostProcessor.java | 18 +++++++------- 19 files changed, 98 insertions(+), 98 deletions(-) rename hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/{BootstrapCoreProperties.java => BootstrapConfigProperties.java} (95%) rename hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/{Hippo4jCoreDynamicRefreshEvent.java => Hippo4jConfigDynamicRefreshEvent.java} (70%) rename hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/{Hippo4jCoreDynamicRefreshEventOrder.java => Hippo4jConfigDynamicRefreshEventOrder.java} (90%) diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/BootstrapCoreProperties.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/BootstrapConfigProperties.java similarity index 95% rename from hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/BootstrapCoreProperties.java rename to hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/BootstrapConfigProperties.java index 12faa712..54159c8d 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/BootstrapCoreProperties.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/BootstrapConfigProperties.java @@ -31,8 +31,8 @@ import java.util.Map; */ @Getter @Setter -@ConfigurationProperties(prefix = BootstrapCoreProperties.PREFIX) -public class BootstrapCoreProperties implements BootstrapPropertiesInterface { +@ConfigurationProperties(prefix = BootstrapConfigProperties.PREFIX) +public class BootstrapConfigProperties implements BootstrapPropertiesInterface { public static final String PREFIX = "spring.dynamic.thread-pool"; diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/ConfigHandlerConfiguration.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/ConfigHandlerConfiguration.java index ab25a586..23bca9d3 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/ConfigHandlerConfiguration.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/ConfigHandlerConfiguration.java @@ -48,19 +48,19 @@ public class ConfigHandlerConfiguration { @RequiredArgsConstructor @ConditionalOnClass(ConfigService.class) @ConditionalOnMissingClass(NACOS_CONFIG_MANAGER_KEY) - @ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, name = NACOS_DATA_ID_KEY) + @ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = NACOS_DATA_ID_KEY) static class EmbeddedNacos { - public final BootstrapCoreProperties bootstrapCoreProperties; + public final BootstrapConfigProperties bootstrapConfigProperties; @Bean public NacosRefresherHandler nacosRefresherHandler() { - return new NacosRefresherHandler(bootstrapCoreProperties); + return new NacosRefresherHandler(bootstrapConfigProperties); } } @ConditionalOnClass(NacosConfigManager.class) - @ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, name = NACOS_DATA_ID_KEY) + @ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = NACOS_DATA_ID_KEY) static class EmbeddedNacosCloud { @Bean @@ -70,7 +70,7 @@ public class ConfigHandlerConfiguration { } @ConditionalOnClass(com.ctrip.framework.apollo.ConfigService.class) - @ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, name = APOLLO_NAMESPACE_KEY) + @ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = APOLLO_NAMESPACE_KEY) static class EmbeddedApollo { @Bean @@ -80,7 +80,7 @@ public class ConfigHandlerConfiguration { } @ConditionalOnClass(CuratorFramework.class) - @ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, name = ZOOKEEPER_CONNECT_STR_KEY) + @ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, name = ZOOKEEPER_CONNECT_STR_KEY) static class EmbeddedZookeeper { @Bean diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/DynamicThreadPoolCoreAutoConfiguration.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/DynamicThreadPoolCoreAutoConfiguration.java index 09bde6f0..a221798f 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/DynamicThreadPoolCoreAutoConfiguration.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/config/DynamicThreadPoolCoreAutoConfiguration.java @@ -54,16 +54,16 @@ import org.springframework.core.annotation.Order; @Configuration @AllArgsConstructor @ConditionalOnBean(MarkerConfiguration.Marker.class) -@EnableConfigurationProperties(BootstrapCoreProperties.class) +@EnableConfigurationProperties(BootstrapConfigProperties.class) @ImportAutoConfiguration({UtilAutoConfiguration.class, MessageConfiguration.class}) -@ConditionalOnProperty(prefix = BootstrapCoreProperties.PREFIX, value = "enable", matchIfMissing = true, havingValue = "true") +@ConditionalOnProperty(prefix = BootstrapConfigProperties.PREFIX, value = "enable", matchIfMissing = true, havingValue = "true") @Import({ ConfigHandlerConfiguration.EmbeddedNacos.class, ConfigHandlerConfiguration.EmbeddedNacosCloud.class, ConfigHandlerConfiguration.EmbeddedApollo.class, ConfigHandlerConfiguration.EmbeddedZookeeper.class }) public class DynamicThreadPoolCoreAutoConfiguration { - private final BootstrapCoreProperties bootstrapCoreProperties; + private final BootstrapConfigProperties bootstrapConfigProperties; @Bean @ConditionalOnMissingBean @@ -74,7 +74,7 @@ public class DynamicThreadPoolCoreAutoConfiguration { @Bean public NotifyConfigBuilder notifyConfigBuilder(AlarmControlHandler alarmControlHandler) { - return new CoreNotifyConfigBuilder(alarmControlHandler, bootstrapCoreProperties); + return new CoreNotifyConfigBuilder(alarmControlHandler, bootstrapConfigProperties); } @Bean @@ -84,12 +84,12 @@ public class DynamicThreadPoolCoreAutoConfiguration { @Bean public DynamicThreadPoolPostProcessor dynamicThreadPoolPostProcessor(ApplicationContextHolder hippo4JApplicationContextHolder) { - return new DynamicThreadPoolPostProcessor(bootstrapCoreProperties); + return new DynamicThreadPoolPostProcessor(bootstrapConfigProperties); } @Bean public DynamicThreadPoolMonitorExecutor hippo4jDynamicThreadPoolMonitorExecutor() { - return new DynamicThreadPoolMonitorExecutor(bootstrapCoreProperties); + return new DynamicThreadPoolMonitorExecutor(bootstrapConfigProperties); } @Bean @@ -117,12 +117,12 @@ public class DynamicThreadPoolCoreAutoConfiguration { @Bean public DynamicThreadPoolAdapterRegister threadPoolAdapterRegister() { - return new DynamicThreadPoolAdapterRegister(bootstrapCoreProperties); + return new DynamicThreadPoolAdapterRegister(bootstrapConfigProperties); } @Bean public DynamicThreadPoolBannerHandler threadPoolBannerHandler() { - return new DynamicThreadPoolBannerHandler(bootstrapCoreProperties); + return new DynamicThreadPoolBannerHandler(bootstrapConfigProperties); } @Bean diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/monitor/DynamicThreadPoolMonitorExecutor.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/monitor/DynamicThreadPoolMonitorExecutor.java index 38f295a4..d2cd6fc8 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/monitor/DynamicThreadPoolMonitorExecutor.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/monitor/DynamicThreadPoolMonitorExecutor.java @@ -21,7 +21,7 @@ import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.common.toolkit.StringUtil; import cn.hippo4j.core.executor.support.ThreadFactoryBuilder; import cn.hippo4j.common.spi.DynamicThreadPoolServiceLoader; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.monitor.base.DynamicThreadPoolMonitor; import cn.hippo4j.monitor.base.ThreadPoolMonitor; import com.google.common.collect.Lists; @@ -43,7 +43,7 @@ import java.util.concurrent.TimeUnit; @RequiredArgsConstructor public class DynamicThreadPoolMonitorExecutor implements ApplicationRunner { - private final BootstrapCoreProperties properties; + private final BootstrapConfigProperties properties; private ScheduledThreadPoolExecutor collectExecutor; diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/notify/CoreNotifyConfigBuilder.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/notify/CoreNotifyConfigBuilder.java index dd05837c..fd592577 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/notify/CoreNotifyConfigBuilder.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/notify/CoreNotifyConfigBuilder.java @@ -19,7 +19,7 @@ package cn.hippo4j.core.springboot.starter.notify; import cn.hippo4j.common.toolkit.CollectionUtil; import cn.hippo4j.common.toolkit.StringUtil; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.config.ExecutorProperties; import cn.hippo4j.core.springboot.starter.config.NotifyPlatformProperties; import cn.hippo4j.message.service.AlarmControlHandler; @@ -45,13 +45,13 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { private final AlarmControlHandler alarmControlHandler; - private final BootstrapCoreProperties bootstrapCoreProperties; + private final BootstrapConfigProperties bootstrapConfigProperties; @Override public Map> buildNotify() { Map> resultMap = Maps.newHashMap(); - boolean globalAlarm = bootstrapCoreProperties.getAlarm(); - List executors = bootstrapCoreProperties.getExecutors(); + boolean globalAlarm = bootstrapConfigProperties.getAlarm(); + List executors = bootstrapConfigProperties.getExecutors(); if (CollectionUtil.isEmpty(executors)) { log.warn("Failed to build notify, executors configuration is empty."); return resultMap; @@ -79,7 +79,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { String threadPoolId = executor.getThreadPoolId(); String alarmBuildKey = threadPoolId + "+ALARM"; List alarmNotifyConfigs = Lists.newArrayList(); - List notifyPlatforms = bootstrapCoreProperties.getNotifyPlatforms(); + List notifyPlatforms = bootstrapConfigProperties.getNotifyPlatforms(); for (NotifyPlatformProperties platformProperties : notifyPlatforms) { NotifyConfigDTO notifyConfig = new NotifyConfigDTO(); notifyConfig.setPlatform(platformProperties.getPlatform()); @@ -89,7 +89,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { notifyConfig.setSecretKey(getToken(platformProperties)); int interval = Optional.ofNullable(executor.getNotify()) .map(each -> each.getInterval()) - .orElseGet(() -> bootstrapCoreProperties.getAlarmInterval() != null ? bootstrapCoreProperties.getAlarmInterval() : 5); + .orElseGet(() -> bootstrapConfigProperties.getAlarmInterval() != null ? bootstrapConfigProperties.getAlarmInterval() : 5); notifyConfig.setInterval(interval); notifyConfig.setReceives(buildReceive(executor, platformProperties)); alarmNotifyConfigs.add(notifyConfig); @@ -123,10 +123,10 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { if (executor.getNotify() != null) { receive = executor.getNotify().getReceives(); if (StrUtil.isBlank(receive)) { - receive = bootstrapCoreProperties.getReceives(); + receive = bootstrapConfigProperties.getReceives(); } } else { - receive = bootstrapCoreProperties.getReceives(); + receive = bootstrapConfigProperties.getReceives(); } return receive; } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java index db75f1ca..a1ca9968 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java @@ -21,9 +21,9 @@ import cn.hippo4j.common.api.ThreadPoolDynamicRefresh; import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.common.toolkit.CollectionUtil; import cn.hippo4j.core.executor.support.ThreadPoolBuilder; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.parser.ConfigParserHandler; -import cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jCoreDynamicRefreshEvent; +import cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jConfigDynamicRefreshEvent; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.InitializingBean; @@ -39,12 +39,12 @@ import java.util.concurrent.ExecutorService; @RequiredArgsConstructor public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh, InitializingBean { - protected final BootstrapCoreProperties bootstrapCoreProperties; + protected final BootstrapConfigProperties bootstrapConfigProperties; protected final ExecutorService dynamicRefreshExecutorService = ThreadPoolBuilder.builder().singlePool("client.dynamic.refresh").build(); public AbstractCoreThreadPoolDynamicRefresh() { - bootstrapCoreProperties = ApplicationContextHolder.getBean(BootstrapCoreProperties.class); + bootstrapConfigProperties = ApplicationContextHolder.getBean(BootstrapConfigProperties.class); } @Override @@ -55,12 +55,12 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool @Override public void dynamicRefresh(String configContent, Map newValueChangeMap) { try { - Map configInfo = ConfigParserHandler.getInstance().parseConfig(configContent, bootstrapCoreProperties.getConfigFileType()); + Map configInfo = ConfigParserHandler.getInstance().parseConfig(configContent, bootstrapConfigProperties.getConfigFileType()); if (CollectionUtil.isNotEmpty(newValueChangeMap)) { Optional.ofNullable(configInfo).ifPresent(each -> each.putAll(newValueChangeMap)); } - BootstrapCoreProperties bindableCoreProperties = BootstrapCorePropertiesBinderAdapt.bootstrapCorePropertiesBinder(configInfo, bootstrapCoreProperties); - ApplicationContextHolder.getInstance().publishEvent(new Hippo4jCoreDynamicRefreshEvent(this, bindableCoreProperties)); + BootstrapConfigProperties bindableCoreProperties = BootstrapCorePropertiesBinderAdapt.bootstrapCorePropertiesBinder(configInfo, bootstrapConfigProperties); + ApplicationContextHolder.getInstance().publishEvent(new Hippo4jConfigDynamicRefreshEvent(this, bindableCoreProperties)); } catch (Exception ex) { log.error("Hippo-4J core dynamic refresh failed.", ex); } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java index 89ce57aa..177b4bb6 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java @@ -29,7 +29,7 @@ import org.springframework.beans.factory.annotation.Value; import java.util.Map; -import static cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties.PREFIX; +import static cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties.PREFIX; /** * Apollo refresher handler. @@ -46,10 +46,10 @@ public class ApolloRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh public void afterPropertiesSet() { String[] apolloNamespaces = this.namespace.split(","); this.namespace = apolloNamespaces[0]; - Config config = ConfigService.getConfig(String.format("%s.%s", namespace, bootstrapCoreProperties.getConfigFileType().getValue())); + Config config = ConfigService.getConfig(String.format("%s.%s", namespace, bootstrapConfigProperties.getConfigFileType().getValue())); ConfigChangeListener configChangeListener = configChangeEvent -> { - String namespace = this.namespace.replaceAll("." + bootstrapCoreProperties.getConfigFileType().getValue(), ""); - ConfigFileFormat configFileFormat = ConfigFileFormat.fromString(bootstrapCoreProperties.getConfigFileType().getValue()); + String namespace = this.namespace.replaceAll("." + bootstrapConfigProperties.getConfigFileType().getValue(), ""); + ConfigFileFormat configFileFormat = ConfigFileFormat.fromString(bootstrapConfigProperties.getConfigFileType().getValue()); ConfigFile configFile = ConfigService.getConfigFile(namespace, configFileFormat); Map newChangeValueMap = Maps.newHashMap(); configChangeEvent.changedKeys().stream().filter(each -> each.contains(PREFIX)).forEach(each -> { diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/BootstrapCorePropertiesBinderAdapt.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/BootstrapCorePropertiesBinderAdapt.java index 38978be1..66848026 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/BootstrapCorePropertiesBinderAdapt.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/BootstrapCorePropertiesBinderAdapt.java @@ -19,7 +19,7 @@ package cn.hippo4j.core.springboot.starter.refresher; import cn.hippo4j.common.toolkit.CollectionUtil; import cn.hippo4j.common.toolkit.StringUtil; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.config.DynamicThreadPoolNotifyProperties; import cn.hippo4j.core.springboot.starter.config.ExecutorProperties; import cn.hippo4j.core.springboot.starter.config.NotifyPlatformProperties; @@ -35,7 +35,7 @@ import org.springframework.boot.context.properties.source.MapConfigurationProper import java.util.List; import java.util.Map; -import static cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties.PREFIX; +import static cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties.PREFIX; /** * Bootstrap core properties binder adapt. @@ -46,15 +46,15 @@ public class BootstrapCorePropertiesBinderAdapt { * Bootstrap core properties binder. * * @param configInfo - * @param bootstrapCoreProperties + * @param bootstrapConfigProperties * @return */ - public static BootstrapCoreProperties bootstrapCorePropertiesBinder(Map configInfo, BootstrapCoreProperties bootstrapCoreProperties) { - BootstrapCoreProperties bindableCoreProperties = null; + public static BootstrapConfigProperties bootstrapCorePropertiesBinder(Map configInfo, BootstrapConfigProperties bootstrapConfigProperties) { + BootstrapConfigProperties bindableCoreProperties = null; try { ConfigurationPropertySource sources = new MapConfigurationPropertySource(configInfo); Binder binder = new Binder(sources); - bindableCoreProperties = binder.bind(PREFIX, Bindable.ofInstance(bootstrapCoreProperties)).get(); + bindableCoreProperties = binder.bind(PREFIX, Bindable.ofInstance(bootstrapConfigProperties)).get(); } catch (Exception ex) { try { Class.forName("org.springframework.boot.context.properties.bind.Binder"); @@ -72,8 +72,8 @@ public class BootstrapCorePropertiesBinderAdapt { * @return */ @Deprecated - private static BootstrapCoreProperties adapt(Map configInfo) { - BootstrapCoreProperties bindableCoreProperties; + private static BootstrapConfigProperties adapt(Map configInfo) { + BootstrapConfigProperties bindableConfigProperties; try { // filter Map targetMap = Maps.newHashMap(); @@ -150,12 +150,12 @@ public class BootstrapCorePropertiesBinderAdapt { } } } - bindableCoreProperties = new BootstrapCoreProperties(); - bindableCoreProperties.setExecutors(executorPropertiesList); - bindableCoreProperties.setNotifyPlatforms(notifyPropertiesList); + bindableConfigProperties = new BootstrapConfigProperties(); + bindableConfigProperties.setExecutors(executorPropertiesList); + bindableConfigProperties.setNotifyPlatforms(notifyPropertiesList); } catch (Exception ex) { throw ex; } - return bindableCoreProperties; + return bindableConfigProperties; } } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosCloudRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosCloudRefresherHandler.java index 1afb4ad5..a7eab883 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosCloudRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosCloudRefresherHandler.java @@ -39,7 +39,7 @@ public class NacosCloudRefresherHandler extends AbstractCoreThreadPoolDynamicRef @Override public void afterPropertiesSet() throws Exception { - Map nacosConfig = bootstrapCoreProperties.getNacos(); + Map nacosConfig = bootstrapConfigProperties.getNacos(); nacosConfigManager.getConfigService().addListener(nacosConfig.get("data-id"), nacosConfig.get("group"), new Listener() { diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosRefresherHandler.java index 652ed484..934600a2 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/NacosRefresherHandler.java @@ -17,7 +17,7 @@ package cn.hippo4j.core.springboot.starter.refresher; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import com.alibaba.nacos.api.annotation.NacosInjected; import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.config.listener.Listener; @@ -35,13 +35,13 @@ public class NacosRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh @NacosInjected private ConfigService configService; - public NacosRefresherHandler(BootstrapCoreProperties bootstrapCoreProperties) { - super(bootstrapCoreProperties); + public NacosRefresherHandler(BootstrapConfigProperties bootstrapConfigProperties) { + super(bootstrapConfigProperties); } @Override public void afterPropertiesSet() throws Exception { - Map nacosConfig = bootstrapCoreProperties.getNacos(); + Map nacosConfig = bootstrapConfigProperties.getNacos(); configService.addListener(nacosConfig.get("data-id"), nacosConfig.get("group"), new Listener() { diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ZookeeperRefresherHandler.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ZookeeperRefresherHandler.java index 1713f7b4..e56baa88 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ZookeeperRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ZookeeperRefresherHandler.java @@ -45,7 +45,7 @@ public class ZookeeperRefresherHandler extends AbstractCoreThreadPoolDynamicRefr @Override public void afterPropertiesSet() { - Map zkConfigs = bootstrapCoreProperties.getZookeeper(); + Map zkConfigs = bootstrapConfigProperties.getZookeeper(); curatorFramework = CuratorFrameworkFactory.newClient(zkConfigs.get("zk-connect-str"), new ExponentialBackoffRetry(1000, 3)); String nodePath = ZKPaths.makePath(ZKPaths.makePath(zkConfigs.get("root-node"), @@ -108,7 +108,7 @@ public class ZookeeperRefresherHandler extends AbstractCoreThreadPoolDynamicRefr * Register notify alarm manage. */ public void registerNotifyAlarmManage() { - bootstrapCoreProperties.getExecutors().forEach(executorProperties -> { + bootstrapConfigProperties.getExecutors().forEach(executorProperties -> { ThreadPoolNotifyAlarm threadPoolNotifyAlarm = new ThreadPoolNotifyAlarm( executorProperties.getAlarm(), executorProperties.getCapacityAlarm(), diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java index a0ec4b53..0c30311c 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java @@ -32,7 +32,7 @@ import java.util.Map; import java.util.Objects; import static cn.hippo4j.common.constant.Constants.IDENTIFY_SLICER_SYMBOL; -import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jCoreDynamicRefreshEventOrder.ADAPTER_EXECUTORS_LISTENER; +import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jConfigDynamicRefreshEventOrder.ADAPTER_EXECUTORS_LISTENER; import static cn.hippo4j.core.springboot.starter.support.DynamicThreadPoolAdapterRegister.ADAPTER_EXECUTORS_MAP; /** @@ -40,13 +40,13 @@ import static cn.hippo4j.core.springboot.starter.support.DynamicThreadPoolAdapte */ @Slf4j @Order(ADAPTER_EXECUTORS_LISTENER) -public class AdapterExecutorsRefreshListener implements ApplicationListener { +public class AdapterExecutorsRefreshListener implements ApplicationListener { @Override - public void onApplicationEvent(Hippo4jCoreDynamicRefreshEvent event) { + public void onApplicationEvent(Hippo4jConfigDynamicRefreshEvent event) { List adapterExecutors; Map threadPoolAdapterMap = ApplicationContextHolder.getBeansOfType(ThreadPoolAdapter.class); - if (CollectionUtil.isEmpty(adapterExecutors = event.getBootstrapCoreProperties().getAdapterExecutors()) || CollectionUtil.isEmpty(threadPoolAdapterMap)) { + if (CollectionUtil.isEmpty(adapterExecutors = event.getBootstrapConfigProperties().getAdapterExecutors()) || CollectionUtil.isEmpty(threadPoolAdapterMap)) { return; } for (AdapterExecutorProperties each : adapterExecutors) { diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java index e7d07c80..09442e8b 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java @@ -27,7 +27,7 @@ import cn.hippo4j.common.executor.support.BlockingQueueTypeEnum; import cn.hippo4j.common.executor.support.RejectedPolicyTypeEnum; import cn.hippo4j.common.executor.support.ResizableCapacityLinkedBlockingQueue; import cn.hippo4j.core.proxy.RejectedProxyUtil; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.config.ExecutorProperties; import cn.hippo4j.core.springboot.starter.notify.CoreNotifyConfigBuilder; import cn.hippo4j.core.springboot.starter.support.GlobalCoreThreadPoolManage; @@ -51,7 +51,7 @@ import java.util.concurrent.atomic.AtomicLong; import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_DELIMITER; import static cn.hippo4j.common.constant.ChangeThreadPoolConstants.CHANGE_THREAD_POOL_TEXT; -import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jCoreDynamicRefreshEventOrder.EXECUTORS_LISTENER; +import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jConfigDynamicRefreshEventOrder.EXECUTORS_LISTENER; /** * Dynamic thread-pool refresh listener. @@ -59,7 +59,7 @@ import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jCoreDyna @Slf4j @RequiredArgsConstructor @Order(EXECUTORS_LISTENER) -public class DynamicThreadPoolRefreshListener implements ApplicationListener { +public class DynamicThreadPoolRefreshListener implements ApplicationListener { private final ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler; @@ -68,9 +68,9 @@ public class DynamicThreadPoolRefreshListener implements ApplicationListener executors = bindableCoreProperties.getExecutors(); + public void onApplicationEvent(Hippo4jConfigDynamicRefreshEvent threadPoolDynamicRefreshEvent) { + BootstrapConfigProperties bindableConfigProperties = threadPoolDynamicRefreshEvent.getBootstrapConfigProperties(); + List executors = bindableConfigProperties.getExecutors(); for (ExecutorProperties properties : executors) { String threadPoolId = properties.getThreadPoolId(); // Check whether the notification configuration is consistent. diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jCoreDynamicRefreshEvent.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jConfigDynamicRefreshEvent.java similarity index 70% rename from hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jCoreDynamicRefreshEvent.java rename to hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jConfigDynamicRefreshEvent.java index bb979f96..d35f7ec4 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jCoreDynamicRefreshEvent.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jConfigDynamicRefreshEvent.java @@ -17,22 +17,22 @@ package cn.hippo4j.core.springboot.starter.refresher.event; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import lombok.Getter; import lombok.Setter; import org.springframework.context.ApplicationEvent; /** - * Hippo-4j core dynamic refresh event. + * Hippo-4j config dynamic refresh event. */ -public class Hippo4jCoreDynamicRefreshEvent extends ApplicationEvent { +public class Hippo4jConfigDynamicRefreshEvent extends ApplicationEvent { @Getter @Setter - private BootstrapCoreProperties bootstrapCoreProperties; + private BootstrapConfigProperties bootstrapConfigProperties; - public Hippo4jCoreDynamicRefreshEvent(Object source, BootstrapCoreProperties bootstrapCoreProperties) { + public Hippo4jConfigDynamicRefreshEvent(Object source, BootstrapConfigProperties bootstrapConfigProperties) { super(source); - this.bootstrapCoreProperties = bootstrapCoreProperties; + this.bootstrapConfigProperties = bootstrapConfigProperties; } } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jCoreDynamicRefreshEventOrder.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jConfigDynamicRefreshEventOrder.java similarity index 90% rename from hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jCoreDynamicRefreshEventOrder.java rename to hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jConfigDynamicRefreshEventOrder.java index 72c4641f..64838b70 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jCoreDynamicRefreshEventOrder.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/Hippo4jConfigDynamicRefreshEventOrder.java @@ -18,9 +18,9 @@ package cn.hippo4j.core.springboot.starter.refresher.event; /** - * Hippo-4j core dynamic refresh event order. + * Hippo-4j config dynamic refresh event order. */ -public interface Hippo4jCoreDynamicRefreshEventOrder { +public interface Hippo4jConfigDynamicRefreshEventOrder { int WEB_EXECUTOR_LISTENER = 0; diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/PlatformsRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/PlatformsRefreshListener.java index c3f9b8a7..c73ea1a0 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/PlatformsRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/PlatformsRefreshListener.java @@ -20,7 +20,7 @@ package cn.hippo4j.core.springboot.starter.refresher.event; import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.core.executor.DynamicThreadPoolWrapper; import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.config.ExecutorProperties; import cn.hippo4j.core.springboot.starter.notify.CoreNotifyConfigBuilder; import cn.hippo4j.message.dto.NotifyConfigDTO; @@ -31,18 +31,18 @@ import org.springframework.core.annotation.Order; import java.util.List; import java.util.Map; -import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jCoreDynamicRefreshEventOrder.PLATFORMS_LISTENER; +import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jConfigDynamicRefreshEventOrder.PLATFORMS_LISTENER; /** * Platforms refresh listener. */ @Order(PLATFORMS_LISTENER) -public class PlatformsRefreshListener implements ApplicationListener { +public class PlatformsRefreshListener implements ApplicationListener { @Override - public void onApplicationEvent(Hippo4jCoreDynamicRefreshEvent threadPoolDynamicRefreshEvent) { - BootstrapCoreProperties bindableCoreProperties = threadPoolDynamicRefreshEvent.getBootstrapCoreProperties(); - List executors = bindableCoreProperties.getExecutors(); + public void onApplicationEvent(Hippo4jConfigDynamicRefreshEvent threadPoolDynamicRefreshEvent) { + BootstrapConfigProperties bindableConfigProperties = threadPoolDynamicRefreshEvent.getBootstrapConfigProperties(); + List executors = bindableConfigProperties.getExecutors(); for (ExecutorProperties executorProperties : executors) { String threadPoolId = executorProperties.getThreadPoolId(); DynamicThreadPoolWrapper wrapper = GlobalThreadPoolManage.getExecutorService(threadPoolId); diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/WebExecutorRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/WebExecutorRefreshListener.java index 96a8ee7e..05bcbb1e 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/WebExecutorRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/event/WebExecutorRefreshListener.java @@ -22,7 +22,7 @@ import cn.hippo4j.adapter.web.WebThreadPoolService; import cn.hippo4j.common.config.ApplicationContextHolder; import cn.hippo4j.common.model.ThreadPoolParameter; import cn.hippo4j.common.model.ThreadPoolParameterInfo; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.config.WebThreadPoolProperties; import lombok.extern.slf4j.Slf4j; import org.springframework.context.ApplicationListener; @@ -30,18 +30,18 @@ import org.springframework.core.annotation.Order; import java.util.Objects; -import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jCoreDynamicRefreshEventOrder.WEB_EXECUTOR_LISTENER; +import static cn.hippo4j.core.springboot.starter.refresher.event.Hippo4jConfigDynamicRefreshEventOrder.WEB_EXECUTOR_LISTENER; /** * Web executor refresh listener. */ @Slf4j @Order(WEB_EXECUTOR_LISTENER) -public class WebExecutorRefreshListener implements ApplicationListener { +public class WebExecutorRefreshListener implements ApplicationListener { @Override - public void onApplicationEvent(Hippo4jCoreDynamicRefreshEvent threadPoolDynamicRefreshEvent) { - BootstrapCoreProperties bindableCoreProperties = threadPoolDynamicRefreshEvent.getBootstrapCoreProperties(); + public void onApplicationEvent(Hippo4jConfigDynamicRefreshEvent threadPoolDynamicRefreshEvent) { + BootstrapConfigProperties bindableCoreProperties = threadPoolDynamicRefreshEvent.getBootstrapConfigProperties(); boolean isNullFlag = bindableCoreProperties.getJetty() == null && bindableCoreProperties.getUndertow() == null && bindableCoreProperties.getTomcat() == null; @@ -65,7 +65,7 @@ public class WebExecutorRefreshListener implements ApplicationListener ADAPTER_EXECUTORS_MAP = Maps.newConcurrentMap(); @Override public void run(ApplicationArguments args) throws Exception { List adapterExecutors; - if (CollectionUtil.isEmpty(adapterExecutors = bootstrapCoreProperties.getAdapterExecutors())) { + if (CollectionUtil.isEmpty(adapterExecutors = bootstrapConfigProperties.getAdapterExecutors())) { return; } for (AdapterExecutorProperties each : adapterExecutors) { diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/support/DynamicThreadPoolPostProcessor.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/support/DynamicThreadPoolPostProcessor.java index 739323cd..f395200e 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/support/DynamicThreadPoolPostProcessor.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/support/DynamicThreadPoolPostProcessor.java @@ -28,7 +28,7 @@ import cn.hippo4j.core.executor.manage.GlobalNotifyAlarmManage; import cn.hippo4j.core.executor.manage.GlobalThreadPoolManage; import cn.hippo4j.core.executor.support.*; import cn.hippo4j.core.executor.support.adpter.DynamicThreadPoolAdapterChoose; -import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; +import cn.hippo4j.core.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.core.springboot.starter.config.DynamicThreadPoolNotifyProperties; import cn.hippo4j.core.springboot.starter.config.ExecutorProperties; import cn.hippo4j.core.toolkit.inet.DynamicThreadPoolAnnotationUtil; @@ -52,7 +52,7 @@ import java.util.concurrent.TimeUnit; @AllArgsConstructor public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { - private final BootstrapCoreProperties bootstrapCoreProperties; + private final BootstrapConfigProperties bootstrapConfigProperties; @Override public Object postProcessBeforeInitialization(Object bean, String beanName) { @@ -110,8 +110,8 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { String threadPoolId = dynamicThreadPoolWrapper.getThreadPoolId(); ThreadPoolExecutor newDynamicPoolExecutor = dynamicThreadPoolWrapper.getExecutor(); ExecutorProperties executorProperties = null; - if (null != bootstrapCoreProperties.getExecutors()) { - executorProperties = bootstrapCoreProperties.getExecutors() + if (null != bootstrapConfigProperties.getExecutors()) { + executorProperties = bootstrapConfigProperties.getExecutors() .stream() .filter(each -> Objects.equals(threadPoolId, each.getThreadPoolId())) .findFirst() @@ -142,15 +142,15 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { if (dynamicThreadPoolWrapper.getExecutor() instanceof AbstractDynamicExecutorSupport) { DynamicThreadPoolNotifyProperties notify = Optional.ofNullable(executorProperties).map(ExecutorProperties::getNotify).orElse(null); boolean isAlarm = Optional.ofNullable(executorProperties.getAlarm()) - .orElseGet(() -> bootstrapCoreProperties.getAlarm() != null ? bootstrapCoreProperties.getAlarm() : true); + .orElseGet(() -> bootstrapConfigProperties.getAlarm() != null ? bootstrapConfigProperties.getAlarm() : true); int activeAlarm = Optional.ofNullable(executorProperties.getActiveAlarm()) - .orElseGet(() -> bootstrapCoreProperties.getActiveAlarm() != null ? bootstrapCoreProperties.getActiveAlarm() : 80); + .orElseGet(() -> bootstrapConfigProperties.getActiveAlarm() != null ? bootstrapConfigProperties.getActiveAlarm() : 80); int capacityAlarm = Optional.ofNullable(executorProperties.getCapacityAlarm()) - .orElseGet(() -> bootstrapCoreProperties.getCapacityAlarm() != null ? bootstrapCoreProperties.getCapacityAlarm() : 80); + .orElseGet(() -> bootstrapConfigProperties.getCapacityAlarm() != null ? bootstrapConfigProperties.getCapacityAlarm() : 80); int interval = Optional.ofNullable(notify) - .map(each -> each.getInterval()).orElseGet(() -> bootstrapCoreProperties.getAlarmInterval() != null ? bootstrapCoreProperties.getAlarmInterval() : 5); + .map(each -> each.getInterval()).orElseGet(() -> bootstrapConfigProperties.getAlarmInterval() != null ? bootstrapConfigProperties.getAlarmInterval() : 5); String receive = Optional.ofNullable(notify) - .map(each -> each.getReceives()).orElseGet(() -> StringUtil.isNotEmpty(bootstrapCoreProperties.getReceives()) ? bootstrapCoreProperties.getReceives() : ""); + .map(each -> each.getReceives()).orElseGet(() -> StringUtil.isNotEmpty(bootstrapConfigProperties.getReceives()) ? bootstrapConfigProperties.getReceives() : ""); ThreadPoolNotifyAlarm threadPoolNotifyAlarm = new ThreadPoolNotifyAlarm(isAlarm, activeAlarm, capacityAlarm); threadPoolNotifyAlarm.setInterval(interval); threadPoolNotifyAlarm.setReceives(receive);