ServerManagementApp.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package org.leanwo.management;
  2. import org.apache.commons.logging.Log;
  3. import org.apache.commons.logging.LogFactory;
  4. import org.leanwo.management.util.ProgramAutoStartUtil;
  5. import org.leanwo.management.util.ProgramStopUtil;
  6. import org.springframework.context.ApplicationContext;
  7. import org.springframework.context.support.FileSystemXmlApplicationContext;
  8. import com.leanwo.management.ServerManagmentJFrame;
  9. /**
  10. * Hello world!
  11. *
  12. */
  13. public class ServerManagementApp {
  14. private static Log logger = LogFactory.getLog(ServerManagmentJFrame.class);
  15. public static void main(String[] args) {
  16. //ProgramStartUtil.generateStartBat();
  17. ProgramAutoStartUtil.generateStartBat();
  18. ProgramStopUtil.generateStopBat();
  19. boolean isAutoRun = false;
  20. if(args != null && args.length > 0) {
  21. if(args[0].equals("autoRun")) {
  22. isAutoRun = true;
  23. }
  24. for(String arg : args) {
  25. logger.info("输出参数:" + arg);
  26. }
  27. }
  28. if(isAutoRun) {
  29. logger.info("程序管理器将会自动运行。");
  30. }
  31. ApplicationContext factory = new FileSystemXmlApplicationContext("config/applicationContext.xml");
  32. ServerManagmentJFrame serverManagmentJFrame = new ServerManagmentJFrame(isAutoRun);
  33. }
  34. }