diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/AbstractWebThreadPoolService.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/AbstractWebThreadPoolService.java index 71531a79..0ef2bab4 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/AbstractWebThreadPoolService.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/AbstractWebThreadPoolService.java @@ -1,17 +1,12 @@ package cn.hippo4j.starter.handler.web; import cn.hippo4j.common.config.ApplicationContextHolder; -import cn.hippo4j.common.model.PoolParameterInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.web.context.WebServerApplicationContext; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.servlet.context.ServletWebServerInitializedEvent; import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationListener; import java.util.concurrent.Executor; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; /** * Abstract web thread pool service. @@ -34,8 +29,6 @@ public abstract class AbstractWebThreadPoolService implements WebThreadPoolServi */ protected abstract Executor getWebThreadPoolByServer(WebServer webServer); - - @Override public Executor getWebThreadPool() { if (executor == null) { diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/UndertowWebThreadPoolHandler.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/UndertowWebThreadPoolHandler.java index b0b2262e..618b1d24 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/UndertowWebThreadPoolHandler.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/handler/web/UndertowWebThreadPoolHandler.java @@ -24,14 +24,11 @@ public class UndertowWebThreadPoolHandler extends AbstractWebThreadPoolService { private static final String UNDERTOW_NAME = "undertow"; - - @Override protected Executor getWebThreadPoolByServer(WebServer webServer) { // There is no need to consider reflection performance because the fetch is a singleton UndertowWebServer undertowWebServer = (UndertowWebServer) webServer; Field undertowField = ReflectionUtils.findField(UndertowWebServer.class, UNDERTOW_NAME); - assert undertowField != null; ReflectionUtils.makeAccessible(undertowField); Undertow undertow = (Undertow) ReflectionUtils.getField(undertowField, undertowWebServer); return Objects.isNull(undertow) ? null : undertow.getWorker();