diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/enums/WebContainerEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/enums/WebContainerEnum.java index a942ff2b..cbdddb21 100644 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/enums/WebContainerEnum.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/enums/WebContainerEnum.java @@ -17,8 +17,35 @@ package cn.hippo4j.common.enums; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * Web container enum. + */ +@RequiredArgsConstructor public enum WebContainerEnum { - TOMCAT, - JETTY, - UNDERTOW + + /** + * Tomcat + */ + TOMCAT("Tomcat"), + + /** + * Jetty + */ + JETTY("Jetty"), + + /** + * Undertow + */ + UNDERTOW("Undertow"); + + @Getter + private final String name; + + @Override + public String toString() { + return getName(); + } } diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/DynamicThreadPoolAutoConfiguration.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/DynamicThreadPoolAutoConfiguration.java index db8843cc..0d748f7e 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/DynamicThreadPoolAutoConfiguration.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/config/DynamicThreadPoolAutoConfiguration.java @@ -106,7 +106,7 @@ public class DynamicThreadPoolAutoConfiguration { WebThreadPoolService webThreadPoolService, Hippo4jSendMessageService hippo4jSendMessageService) { if (bootstrapConfigProperties.getWeb() != null && StringUtil.isBlank(bootstrapConfigProperties.getWeb().getThreadPoolId())) { - bootstrapConfigProperties.getWeb().setThreadPoolId(webThreadPoolService.getWebContainerType().name()); + bootstrapConfigProperties.getWeb().setThreadPoolId(webThreadPoolService.getWebContainerType().getName()); } return new WebThreadPoolConfigChangeHandler(hippo4jSendMessageService); } @@ -130,8 +130,8 @@ public class DynamicThreadPoolAutoConfiguration { } @Bean - public AdapterExecutorsRefreshListener hippo4jAdapterExecutorsListener() { - return new AdapterExecutorsRefreshListener(); + public AdapterExecutorsRefreshListener hippo4jAdapterExecutorsListener(DynamicThreadPoolAdapterRegister dynamicThreadPoolAdapterRegister) { + return new AdapterExecutorsRefreshListener(dynamicThreadPoolAdapterRegister); } @Bean diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/notify/ConfigModeNotifyConfigBuilder.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/notify/ConfigModeNotifyConfigBuilder.java index 7f4e9439..f765ada5 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/notify/ConfigModeNotifyConfigBuilder.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/notify/ConfigModeNotifyConfigBuilder.java @@ -74,7 +74,7 @@ public class ConfigModeNotifyConfigBuilder implements NotifyConfigBuilder { return resultMap; } if (StringUtil.isBlank(webProperties.getThreadPoolId())) { - webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().name()); + webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().getName()); } Map> webSingleNotifyConfigMap = buildSingleNotifyConfig(webProperties); diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/WebExecutorRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/WebExecutorRefreshListener.java index b86b6e01..0baf43b3 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/WebExecutorRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/WebExecutorRefreshListener.java @@ -102,7 +102,7 @@ public class WebExecutorRefreshListener extends AbstractRefreshListener