Add WebServerApplicationContext abstraction

Add a new `WebServerApplicationContext` interface that provides a common
abstraction for all application contexts that create and manage the
lifecycle of an embedded `WebServer`.

Allows server namespaces to become a first-class concept (rather
subverting `ConfigurableWebApplicationContext.getNamespace()`) and
allow us to drop `getServerId()` from `WebServerInitializedEvent`.

Also helps to improve `ManagementContextAutoConfiguration` and
`ManagementContextFactory`.

Fixes gh-11881
This commit is contained in:
Phillip Webb
2018-02-01 14:47:06 -08:00
parent c8257b38a2
commit 3ff772957b
22 changed files with 185 additions and 188 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 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.
@@ -18,7 +18,7 @@ package com.example;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.system.EmbeddedServerPortFileWriter;
import org.springframework.boot.web.context.EmbeddedServerPortFileWriter;
@SpringBootApplication
public class DevToolsTestApplication {