Java 类org.springframework.boot.ExitCodeGenerator 实例源码

项目:test-procrun    文件:TestProcrunApplication.java   
public static void main(String[] args) {
    String mode = args != null && args.length > 0 ? args[0] : null;

    if (logger.isDebugEnabled()) {
        logger.debug("PID:" + ManagementFactory.getRuntimeMXBean().getName() + " Application mode:" + mode + " context:" + applicationContext);
    }
    if (applicationContext != null && mode != null && "stop".equals(mode)) {
        System.exit(SpringApplication.exit(applicationContext, new ExitCodeGenerator() {
            @Override
            public int getExitCode() {
                return 0;
            }
        }));
    }
    else {
        SpringApplication app = new SpringApplication(TestProcrunApplication.class);
        applicationContext = app.run(args);
        if (logger.isDebugEnabled()) {
            logger.debug("PID:" + ManagementFactory.getRuntimeMXBean().getName() + " Application started context:" + applicationContext);
        }
    }
}
项目:XBoxApi    文件:AdminController.java   
@RequestMapping(value = "/admin/shutdown", method = RequestMethod.GET)
public void shutdown() {
  final int exitCode = adminService.savepoint();
  ExitCodeGenerator exitCodeGenerator = new ExitCodeGenerator() {

    @Override
    public int getExitCode() {
      return exitCode;
    }

  };
  SpringApplication.exit(Application.context, exitCodeGenerator); 
}
项目:PSN-API    文件:AdminController.java   
@RequestMapping(value = "/admin/shutdown", method = RequestMethod.GET)
public void shutdown() {
  final int exitCode = adminService.savepoint();
  ExitCodeGenerator exitCodeGenerator = new ExitCodeGenerator() {

    @Override
    public int getExitCode() {
      return exitCode;
    }

  };
  SpringApplication.exit(Application.context, exitCodeGenerator); 
}
项目:midpoint    文件:MidPointSpringApplication.java   
public static void main(String[] args) {
    System.setProperty("xml.catalog.className", CatalogImpl.class.getName());
    String mode = args != null && args.length > 0 ? args[0] : null;

    if(LOGGER.isDebugEnabled()){
        LOGGER.debug("PID:" + ManagementFactory.getRuntimeMXBean().getName() +
                " Application mode:" + mode + " context:" + applicationContext);
    }

    if (applicationContext != null && mode != null && "stop".equals(mode)) {
        System.exit(SpringApplication.exit(applicationContext, new ExitCodeGenerator() {

            @Override
            public int getExitCode() {

                return 0;
            }
        }));

    } else {

        applicationContext = configureApplication(new SpringApplicationBuilder()).run(args);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("PID:" + ManagementFactory.getRuntimeMXBean().getName() +
                         " Application started context:" + applicationContext);
        }

    }

}
项目:midpoint    文件:MidPointSpringApplication.java   
public static void main(String[] args) {
    System.setProperty("xml.catalog.className", CatalogImpl.class.getName());
    String mode = args != null && args.length > 0 ? args[0] : null;

    if(LOGGER.isDebugEnabled()){
        LOGGER.debug("PID:" + ManagementFactory.getRuntimeMXBean().getName() +
                " Application mode:" + mode + " context:" + applicationContext);
    }

    if (applicationContext != null && mode != null && "stop".equals(mode)) {
        System.exit(SpringApplication.exit(applicationContext, new ExitCodeGenerator() {

            @Override
            public int getExitCode() {

                return 0;
            }
        }));

    } else {

        applicationContext = configureApplication(new SpringApplicationBuilder()).run(args);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("PID:" + ManagementFactory.getRuntimeMXBean().getName() +
                         " Application started context:" + applicationContext);
        }

    }

}
项目:S3Mock    文件:S3MockApplication.java   
/**
 * Stops the server.
 */
public void stop() {
  SpringApplication.exit(context, (ExitCodeGenerator) () -> 0);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:BatchAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(ExitCodeGenerator.class)
public JobExecutionExitCodeGenerator jobExecutionExitCodeGenerator() {
    return new JobExecutionExitCodeGenerator();
}
项目:spring-boot-concourse    文件:BatchAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean(ExitCodeGenerator.class)
public JobExecutionExitCodeGenerator jobExecutionExitCodeGenerator() {
    return new JobExecutionExitCodeGenerator();
}
项目:taxonomy    文件:BatchApplication.java   
public static void exit(){
    SpringApplication.exit(appContext, new ExitCodeGenerator[0]);
}
项目:taxonomy    文件:CLIApplication.java   
public static void main(String[] args) throws IOException, ParseException {
ConfigurableApplicationContext application = SpringApplication.run(CLIApplication.class, args);
SpringApplication.exit(application, new ExitCodeGenerator[0]);
   }