本文整理汇总了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);
}
}
}
示例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);
}
示例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);
}
}
}
示例4: stop
import org.springframework.boot.ExitCodeGenerator; //导入依赖的package包/类
/**
* Stops the server.
*/
public void stop() {
SpringApplication.exit(context, (ExitCodeGenerator) () -> 0);
}
示例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]);
}
示例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]);
}