Merge pull request #119 from weihubeats/develop

删除多余空格和多余包
pull/121/head
龙台 Long Tai 3 years ago committed by GitHub
commit ab9d605c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {

@ -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();

Loading…
Cancel
Save