diff --git a/code/smart-community/epmet-auth/src/main/java/com/epmet/AuthApplication.java b/code/smart-community/epmet-auth/src/main/java/com/epmet/AuthApplication.java index 07d85a0d..0bb528e1 100644 --- a/code/smart-community/epmet-auth/src/main/java/com/epmet/AuthApplication.java +++ b/code/smart-community/epmet-auth/src/main/java/com/epmet/AuthApplication.java @@ -1,8 +1,8 @@ /** * Copyright (c) 2018 人人开源 All rights reserved. - * + *
* https://www.renren.io - * + *
* 版权所有,侵权必究!
*/
diff --git a/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java b/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java
index 143fce4f..6397befd 100644
--- a/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java
+++ b/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java
@@ -1,13 +1,13 @@
package com.epmet.commons.tools.config.shutdown;
+import com.tongweb.springboot.starter.TongWebServletWebServerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
- * 优雅停机配置
+ * 优雅停机配置 tomcat转换tongWeb
* matchIfMissing:当缺少shutdown.graceful.enable配置的时候,是否加载该配置类。true:缺少也加载,false:默认的,缺少配置不加载,即不生效
*/
@Configuration
@@ -15,10 +15,10 @@ import org.springframework.context.annotation.Configuration;
public class GracefulShutdownConfig {
@Bean
- public ServletWebServerFactory servletContainer(GracefulShutdownTomcat gracefulShutdownTomcat) {
- TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
- tomcat.addConnectorCustomizers(gracefulShutdownTomcat);
- return tomcat;
+ public ServletWebServerFactory servletContainer(GracefulShutdownTongWeb gracefulShutdownTongWeb) {
+ TongWebServletWebServerFactory tongWeb = new TongWebServletWebServerFactory();
+ tongWeb.addConnectorCustomizers(gracefulShutdownTongWeb);
+ return tongWeb;
}
}
diff --git a/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java b/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTongWeb.java
similarity index 77%
rename from code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java
rename to code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTongWeb.java
index 58ac781e..b4133d3c 100644
--- a/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java
+++ b/code/smart-community/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTongWeb.java
@@ -1,28 +1,26 @@
package com.epmet.commons.tools.config.shutdown;
-import org.apache.catalina.connector.Connector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.tongweb.container.connector.Connector;
+import com.tongweb.springboot.starter.TongWebConnectorCustomizer;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.stereotype.Component;
+import javax.annotation.Resource;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+@Slf4j
@EnableConfigurationProperties(ShutdownProperties.class)
@Component
@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enable", havingValue = "true", matchIfMissing = false)
-public class GracefulShutdownTomcat implements TomcatConnectorCustomizer, ApplicationListener