use of org.springframework.boot.web.server.WebServer in project spring-boot by spring-projects.
the class ServletWebServerApplicationContext method stopAndReleaseWebServer.
private void stopAndReleaseWebServer() {
WebServer webServer = this.webServer;
if (webServer != null) {
try {
webServer.stop();
this.webServer = null;
} catch (Exception ex) {
throw new IllegalStateException(ex);
}
}
}
use of org.springframework.boot.web.server.WebServer in project spring-boot by spring-projects.
the class ServletWebServerApplicationContext method createWebServer.
private void createWebServer() {
WebServer webServer = this.webServer;
ServletContext servletContext = getServletContext();
if (webServer == null && servletContext == null) {
ServletWebServerFactory factory = getWebServerFactory();
this.webServer = factory.getWebServer(getSelfInitializer());
} else if (servletContext != null) {
try {
getSelfInitializer().onStartup(servletContext);
} catch (ServletException ex) {
throw new ApplicationContextException("Cannot initialize servlet context", ex);
}
}
initPropertySources();
}
use of org.springframework.boot.web.server.WebServer in project spring-boot by spring-projects.
the class ReactiveWebServerApplicationContext method createWebServer.
private void createWebServer() {
WebServer localServer = this.webServer;
if (localServer == null) {
this.webServer = getWebServerFactory().getWebServer(getHttpHandler());
}
initPropertySources();
}
use of org.springframework.boot.web.server.WebServer in project spring-boot by spring-projects.
the class EmbeddedServerPortFileWriterTests method mockEvent.
private ServletWebServerInitializedEvent mockEvent(String name, int port) {
ServletWebServerApplicationContext applicationContext = mock(ServletWebServerApplicationContext.class);
WebServer source = mock(WebServer.class);
given(applicationContext.getNamespace()).willReturn(name);
given(source.getPort()).willReturn(port);
ServletWebServerInitializedEvent event = new ServletWebServerInitializedEvent(applicationContext, source);
return event;
}
use of org.springframework.boot.web.server.WebServer in project spring-boot by spring-projects.
the class SkipSslVerificationHttpRequestFactoryTests method getHttpsUrl.
private String getHttpsUrl() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
factory.setSsl(getSsl("password", "classpath:test.jks"));
WebServer webServer = factory.getWebServer(new ServletRegistrationBean<>(new ExampleServlet(), "/hello"));
webServer.start();
return "https://localhost:" + webServer.getPort() + "/hello";
}
Aggregations