Commit b48e31d9 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 4895b15b
......@@ -263,7 +263,6 @@ public class SpringApplication {
* @return a running {@link ApplicationContext}
*/
public ConfigurableApplicationContext run(String... args) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
ConfigurableApplicationContext context = null;
......@@ -481,12 +480,10 @@ public class SpringApplication {
this.mainApplicationClass, System.out);
return;
}
if (this.banner != null) {
this.banner.printBanner(environment, this.mainApplicationClass, System.out);
return;
}
printBanner();
}
......
/*
* Copyright 2012-2014 the original author or authors.
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -49,10 +49,10 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
private static final Log logger = LogFactory
.getLog(UndertowEmbeddedServletContainer.class);
private final DeploymentManager manager;
private final Builder builder;
private final DeploymentManager manager;
private final String contextPath;
private final int port;
......@@ -86,6 +86,25 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
+ getPortsDescription());
}
private Undertow createUndertowServer() {
try {
HttpHandler servletHandler = this.manager.start();
this.builder.setHandler(getContextHandler(servletHandler));
return this.builder.build();
}
catch (ServletException ex) {
throw new EmbeddedServletContainerException(
"Unable to start embdedded Undertow", ex);
}
}
private HttpHandler getContextHandler(HttpHandler servletHandler) {
if (StringUtils.isEmpty(this.contextPath)) {
return servletHandler;
}
return Handlers.path().addPrefixPath(this.contextPath, servletHandler);
}
@SuppressWarnings("rawtypes")
private String getPortsDescription() {
try {
......@@ -111,25 +130,6 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
return String.valueOf(this.port);
}
private Undertow createUndertowServer() {
try {
HttpHandler servletHandler = this.manager.start();
this.builder.setHandler(getContextHandler(servletHandler));
return this.builder.build();
}
catch (ServletException ex) {
throw new EmbeddedServletContainerException(
"Unable to start embdedded Undertow", ex);
}
}
private HttpHandler getContextHandler(HttpHandler servletHandler) {
if (StringUtils.isEmpty(this.contextPath)) {
return servletHandler;
}
return Handlers.path().addPrefixPath(this.contextPath, servletHandler);
}
@Override
public synchronized void stop() throws EmbeddedServletContainerException {
if (this.started) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment