当前位置: 首页>>代码示例>>Java>>正文


Java ExitCodeGenerator类代码示例

本文整理汇总了Java中org.springframework.boot.ExitCodeGenerator的典型用法代码示例。如果您正苦于以下问题:Java ExitCodeGenerator类的具体用法?Java ExitCodeGenerator怎么用?Java ExitCodeGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExitCodeGenerator类属于org.springframework.boot包,在下文中一共展示了ExitCodeGenerator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:francesc79,项目名称:test-procrun,代码行数:23,代码来源:TestProcrunApplication.java

示例2: shutdown

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
@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); 
}
 
开发者ID:elminsterjimmy,项目名称:XBoxApi,代码行数:14,代码来源:AdminController.java

示例3: main

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
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);
        }
        
    }

}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:32,代码来源:MidPointSpringApplication.java

示例4: stop

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
/**
 * Stops the server.
 */
public void stop() {
  SpringApplication.exit(context, (ExitCodeGenerator) () -> 0);
}
 
开发者ID:adobe,项目名称:S3Mock,代码行数:7,代码来源:S3MockApplication.java

示例5: jobExecutionExitCodeGenerator

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(ExitCodeGenerator.class)
public JobExecutionExitCodeGenerator jobExecutionExitCodeGenerator() {
	return new JobExecutionExitCodeGenerator();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:BatchAutoConfiguration.java

示例6: exit

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
public static void exit(){
    SpringApplication.exit(appContext, new ExitCodeGenerator[0]);
}
 
开发者ID:nationalarchives,项目名称:taxonomy,代码行数:4,代码来源:BatchApplication.java

示例7: main

import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
public static void main(String[] args) throws IOException, ParseException {
ConfigurableApplicationContext application = SpringApplication.run(CLIApplication.class, args);
SpringApplication.exit(application, new ExitCodeGenerator[0]);
   }
 
开发者ID:nationalarchives,项目名称:taxonomy,代码行数:5,代码来源:CLIApplication.java


注:本文中的org.springframework.boot.ExitCodeGenerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。