Introduce EmbeddedWebServerInitializedEvent

This commit adds `EmbeddedWebServerInitializedEvent`, which holds the
`EmbeddedWebServer` information when the application context starts.
The `EmbeddedServletContainerInitializedEvent` now inherits from that
type and holds additional information, the
`EmbeddedWebApplicationContext`.

Closes gh-8208
This commit is contained in:
Brian Clozel
2017-02-14 14:30:49 +01:00
parent 924397ff94
commit a5bdbd0dc2
6 changed files with 68 additions and 32 deletions

View File

@@ -896,7 +896,7 @@ public class EndpointWebMvcAutoConfigurationTests {
@Override
public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
if (event.getApplicationContext() != this.rootContext) {
this.servletContainer = event.getEmbeddedServletContainer();
this.servletContainer = event.getEmbeddedWebServer();
}
}