SpringApplicationBuilder
used to generate SpringApplication and
ApplicationContext instances.
Example
ConfigurableApplicationContext
applicationContent = new
SpringApplicationBuilder(Application.class).child(Application.class).web(WebApplicationType.NONE).bannerMode(Banner.Mode.CONSOLE).logStartupInfo(false).run(args);
package com.sample.myApp; import org.springframework.boot.Banner; import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.context.ConfigurableApplicationContext; @SpringBootApplication public class Application { public static void main(String args[]) { ConfigurableApplicationContext applicationContent = new SpringApplicationBuilder(Application.class) .child(Application.class).web(WebApplicationType.NONE).bannerMode(Banner.Mode.CONSOLE) .logStartupInfo(false).run(args); applicationContent.close(); } }
No comments:
Post a Comment