Java Code Examples for org.springframework.boot.builder.SpringApplicationBuilder#web()

The following examples show how to use org.springframework.boot.builder.SpringApplicationBuilder#web() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: YarnCloudAppServiceApplication.java    From spring-cloud-deployer-yarn with Apache License 2.0 6 votes vote down vote up
@Override
public void afterPropertiesSet() throws Exception {
	SpringApplicationBuilder builder = new SpringApplicationBuilder();
	builder.web(false);
	builder.sources(Config.class);
	SpringYarnBootUtils.addSources(builder, sources.toArray(new Object[0]));
	SpringYarnBootUtils.addProfiles(builder, profiles.toArray(new String[0]));
	SpringYarnBootUtils.addApplicationListener(builder, appProperties);
	if (initializers != null) {
		builder.initializers(initializers);
	}
	SpringYarnBootUtils.addConfigFilesContents(builder, configFilesContents);
	context = builder.run(args);
	YarnClient client = context.getBean(YarnClient.class);
	if (client instanceof ApplicationYarnClient) {
		yarnClient = ((ApplicationYarnClient) client);
	} else {
		throw new IllegalArgumentException("YarnClient need to be instanceof ApplicationYarnClient");
	}
	restTemplate = context.getBean(YarnSystemConstants.DEFAULT_ID_RESTTEMPLATE, RestTemplate.class);
	springYarnProperties = context.getBean(SpringYarnProperties.class);
}
 
Example 2
Source File: ScooldServer.java    From scoold with Apache License 2.0 5 votes vote down vote up
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder app) {
	initConfig();
	app.profiles(Config.ENVIRONMENT);
	app.web(WebApplicationType.SERVLET);
	return app.sources(ScooldServer.class);
}
 
Example 3
Source File: Balancer.java    From timely with Apache License 2.0 4 votes vote down vote up
protected static ConfigurableApplicationContext initializeContext(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(SpringBootstrap.class);
    builder.web(WebApplicationType.NONE);
    builder.registerShutdownHook(false);
    return builder.run(args);
}
 
Example 4
Source File: GrafanaAuth.java    From timely with Apache License 2.0 4 votes vote down vote up
protected static ConfigurableApplicationContext initializeContext(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(SpringBootstrap.class);
    builder.web(WebApplicationType.NONE);
    builder.registerShutdownHook(false);
    return builder.run(args);
}
 
Example 5
Source File: Server.java    From timely with Apache License 2.0 4 votes vote down vote up
protected static ConfigurableApplicationContext initializeContext(String[] args) {
    SpringApplicationBuilder builder = new SpringApplicationBuilder(SpringBootstrap.class);
    builder.web(WebApplicationType.NONE);
    builder.registerShutdownHook(false);
    return builder.run(args);
}