pull/2553/head
Phillip Webb 10 years ago
parent 4895b15bec
commit b48e31d9d8

@ -263,7 +263,6 @@ public class SpringApplication {
* @return a running {@link ApplicationContext} * @return a running {@link ApplicationContext}
*/ */
public ConfigurableApplicationContext run(String... args) { public ConfigurableApplicationContext run(String... args) {
StopWatch stopWatch = new StopWatch(); StopWatch stopWatch = new StopWatch();
stopWatch.start(); stopWatch.start();
ConfigurableApplicationContext context = null; ConfigurableApplicationContext context = null;
@ -481,12 +480,10 @@ public class SpringApplication {
this.mainApplicationClass, System.out); this.mainApplicationClass, System.out);
return; return;
} }
if (this.banner != null) { if (this.banner != null) {
this.banner.printBanner(environment, this.mainApplicationClass, System.out); this.banner.printBanner(environment, this.mainApplicationClass, System.out);
return; return;
} }
printBanner(); printBanner();
} }

@ -1,5 +1,5 @@
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 private static final Log logger = LogFactory
.getLog(UndertowEmbeddedServletContainer.class); .getLog(UndertowEmbeddedServletContainer.class);
private final DeploymentManager manager;
private final Builder builder; private final Builder builder;
private final DeploymentManager manager;
private final String contextPath; private final String contextPath;
private final int port; private final int port;
@ -86,6 +86,25 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
+ getPortsDescription()); + 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") @SuppressWarnings("rawtypes")
private String getPortsDescription() { private String getPortsDescription() {
try { try {
@ -111,25 +130,6 @@ public class UndertowEmbeddedServletContainer implements EmbeddedServletContaine
return String.valueOf(this.port); 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 @Override
public synchronized void stop() throws EmbeddedServletContainerException { public synchronized void stop() throws EmbeddedServletContainerException {
if (this.started) { if (this.started) {

Loading…
Cancel
Save