VManageBootstrap.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.genersoft.iot.vmp;
  2. import java.util.logging.LogManager;
  3. import org.springframework.boot.SpringApplication;
  4. import org.springframework.boot.autoconfigure.SpringBootApplication;
  5. import org.springframework.boot.web.servlet.ServletComponentScan;
  6. import org.springframework.context.ConfigurableApplicationContext;
  7. import org.springframework.scheduling.annotation.EnableAsync;
  8. import org.springframework.scheduling.annotation.EnableScheduling;
  9. import springfox.documentation.oas.annotations.EnableOpenApi;
  10. /**
  11. *
  12. */
  13. @ServletComponentScan("com.genersoft.iot.vmp.conf")
  14. @SpringBootApplication
  15. @EnableScheduling
  16. @EnableOpenApi
  17. public class VManageBootstrap extends LogManager {
  18. private static String[] args;
  19. private static ConfigurableApplicationContext context;
  20. public static void main(String[] args) {
  21. VManageBootstrap.args = args;
  22. VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
  23. }
  24. // 项目重启
  25. public static void restart() {
  26. context.close();
  27. VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
  28. }
  29. }