@ -159,9 +159,11 @@ public class EndpointWebMvcManagementContextConfiguration {
@@ -159,9 +159,11 @@ public class EndpointWebMvcManagementContextConfiguration {
@ -52,6 +54,8 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@@ -52,6 +54,8 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@ -65,9 +69,15 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@@ -65,9 +69,15 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@ -173,10 +183,7 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@@ -173,10 +183,7 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@ -184,4 +191,14 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@@ -184,4 +191,14 @@ public class HealthMvcEndpoint extends AbstractEndpointMvcAdapter<HealthEndpoint
@ -125,10 +125,14 @@ public class MvcEndpointSecurityInterceptor extends HandlerInterceptorAdapter {
@@ -125,10 +125,14 @@ public class MvcEndpointSecurityInterceptor extends HandlerInterceptorAdapter {
@ -77,7 +79,8 @@ public class NoSpringSecurityMvcEndpointSecurityInterceptorTests {
@@ -77,7 +79,8 @@ public class NoSpringSecurityMvcEndpointSecurityInterceptorTests {
@ -105,5 +108,5 @@ public class NoSpringSecurityMvcEndpointSecurityInterceptorTests {
@@ -105,5 +108,5 @@ public class NoSpringSecurityMvcEndpointSecurityInterceptorTests {
@ -205,9 +205,6 @@ public class JettyEmbeddedServletContainer implements EmbeddedWebServer {
@@ -205,9 +205,6 @@ public class JettyEmbeddedServletContainer implements EmbeddedWebServer {
@ -90,32 +90,38 @@ public class TomcatEmbeddedServletContainer implements EmbeddedWebServer {
@@ -90,32 +90,38 @@ public class TomcatEmbeddedServletContainer implements EmbeddedWebServer {
synchronized(this.monitor){
try{
addInstanceIdToEngineName();
try{
// Remove service connectors to that protocol binding doesn't happen
// yet
removeServiceConnectors();
// Remove service connectors to that protocol binding doesn't happen yet
removeServiceConnectors();
// Start the server to trigger initialization listeners
this.tomcat.start();
// Start the server to trigger initialization listeners
this.tomcat.start();
// We can re-throw failure exception directly in the main thread
rethrowDeferredStartupExceptions();
// We can re-throw failure exception directly in the main thread
// Unlike Jetty, all Tomcat threads are daemon threads. We create a
// blocking non-daemon to stop immediate shutdown
startDaemonAwaitThread();
}
catch(NamingExceptionex){
// Naming is not enabled. Continue
catch(Exceptionex){
containerCounter.decrementAndGet();
throwex;
}
// Unlike Jetty, all Tomcat threads are daemon threads. We create a
// blocking non-daemon to stop immediate shutdown
startDaemonAwaitThread();
}
catch(Exceptionex){
thrownewEmbeddedWebServerException(
"Unable to start embedded Tomcat",ex);
thrownewEmbeddedWebServerException("Unable to start embedded Tomcat",
ex);
}
}
}
@ -279,9 +285,7 @@ public class TomcatEmbeddedServletContainer implements EmbeddedWebServer {
@@ -279,9 +285,7 @@ public class TomcatEmbeddedServletContainer implements EmbeddedWebServer {
@Override
publicvoidstop()throwsEmbeddedWebServerException{
synchronized(this.monitor){
if(!this.started){
return;
}
booleanwasStarted=this.started;
try{
this.started=false;
try{
@ -293,11 +297,13 @@ public class TomcatEmbeddedServletContainer implements EmbeddedWebServer {
@@ -293,11 +297,13 @@ public class TomcatEmbeddedServletContainer implements EmbeddedWebServer {
}
}
catch(Exceptionex){
thrownewEmbeddedWebServerException(
"Unable to stop embedded Tomcat",ex);
thrownewEmbeddedWebServerException("Unable to stop embedded Tomcat",
@ -174,6 +174,16 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
@@ -174,6 +174,16 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
assertThat(this.output.toString()).containsOnlyOnce("started on port");
@ -315,16 +325,6 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
@@ -315,16 +325,6 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
@ -352,6 +352,16 @@ public class TomcatEmbeddedServletContainerFactoryTests
@@ -352,6 +352,16 @@ public class TomcatEmbeddedServletContainerFactoryTests
.doesNotContain("appears to have started a thread named [main]");