Commit 712b25fb6eea8e85fd2c43d2956529312afdd3dc

Authored by lawrencehj
1 parent 968ec879

增加上级远程启动TeleBoot功能的支持

src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
... ... @@ -4,10 +4,20 @@ import java.util.logging.LogManager;
4 4  
5 5 import org.springframework.boot.SpringApplication;
6 6 import org.springframework.boot.autoconfigure.SpringBootApplication;
  7 +import org.springframework.context.ConfigurableApplicationContext;
7 8  
8 9 @SpringBootApplication
9 10 public class VManageBootstrap extends LogManager {
  11 + private static String[] args;
  12 + private static ConfigurableApplicationContext context;
10 13 public static void main(String[] args) {
11   - SpringApplication.run(VManageBootstrap.class, args);
  14 + VManageBootstrap.args = args;
  15 + VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
  16 + }
  17 + // 项目重启
  18 + public static void restart() {
  19 + context.close();
  20 + VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
  21 +
12 22 }
13 23 }
... ...