コード例 #1
0
 @Override
 public void run(String... args) throws Exception {
   shell.start();
   shell.promptLoop();
   shell.waitForComplete();
   SpringApplication.exit(ctx);
 }
コード例 #2
0
 @Test
 public void testDefaultSettings() throws Exception {
   assertEquals(0, SpringApplication.exit(SpringApplication.run(SampleBatchApplication.class)));
   String output = this.outputCapture.toString();
   assertTrue(
       "Wrong output: " + output, output.contains("completed with the following parameters"));
 }
コード例 #3
0
  public static void main(String... args) {
    ApplicationContext appContext = SpringApplication.run(Application.class, args);

    ContactService contactService = appContext.getBean(ContactService.class);
    System.out.println(contactService.ping());

    SpringApplication.exit(appContext);
  }
コード例 #4
0
  public static void main(String[] args) throws Exception {

    log.info("application start...");
    ApplicationContext ctx = SpringApplication.run(ApplicationConfig.class, args);
    String[] defName = ctx.getBeanDefinitionNames();
    for (String name : defName) {
      log.info("beanDefinitionName={}", name);
    }
    Busboy busboy = ctx.getBean(Busboy.class);
    busboy.test();

    SpringApplication.exit(ctx);
  }
コード例 #5
0
 @AfterClass
 public static void shutdown() {
   if (shutdownAfterRun) {
     logger.info("Stopping Data Flow Shell");
     if (dataFlowShell != null) {
       dataFlowShell.stop();
     }
     if (applicationContext != null) {
       logger.info("Stopping Data Flow Admin Server");
       SpringApplication.exit(applicationContext);
       applicationContext = null;
     }
   }
 }
コード例 #6
0
 /**
  * Explicitly shutdown the application context. Spring guarantees that this explicit shutdown
  * removes the shutdown hook and therefore prevents multiple attempts at shutting down the same
  * context.
  */
 public static void stop() {
   SpringApplication.exit(context);
 }
コード例 #7
0
 public static void main(String[] args) {
   final ConfigurableApplicationContext run =
       SpringApplication.run(HelloWorldBatchConfiguration.class, args);
   log.info(multiplicationOutput.toString());
   System.exit(SpringApplication.exit(run));
 }