From 712b25fb6eea8e85fd2c43d2956529312afdd3dc Mon Sep 17 00:00:00 2001 From: lawrencehj <1934378145@qq.com> Date: Sun, 14 Mar 2021 21:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E7=BA=A7=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E5=90=AF=E5=8A=A8TeleBoot=E5=8A=9F=E8=83=BD=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/VManageBootstrap.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java index 4a92e093..d237b165 100644 --- a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java +++ b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java @@ -4,10 +4,20 @@ import java.util.logging.LogManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; @SpringBootApplication public class VManageBootstrap extends LogManager { + private static String[] args; + private static ConfigurableApplicationContext context; public static void main(String[] args) { - SpringApplication.run(VManageBootstrap.class, args); + VManageBootstrap.args = args; + VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); + } + // 项目重启 + public static void restart() { + context.close(); + VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); + } }