|
|
|
@ -60,6 +60,7 @@ import org.apache.catalina.webresources.StandardRoot;
|
|
|
|
|
import org.apache.coyote.AbstractProtocol;
|
|
|
|
|
import org.apache.coyote.ProtocolHandler;
|
|
|
|
|
import org.apache.coyote.http2.Http2Protocol;
|
|
|
|
|
import org.apache.tomcat.util.modeler.Registry;
|
|
|
|
|
import org.apache.tomcat.util.scan.StandardJarScanFilter;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.util.LambdaSafe;
|
|
|
|
@ -133,6 +134,8 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
|
|
|
|
|
|
|
|
|
|
private int backgroundProcessorDelay;
|
|
|
|
|
|
|
|
|
|
private boolean disableMBeanRegistry = true;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new {@link TomcatServletWebServerFactory} instance.
|
|
|
|
|
*/
|
|
|
|
@ -167,6 +170,9 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public WebServer getWebServer(ServletContextInitializer... initializers) {
|
|
|
|
|
if (this.disableMBeanRegistry) {
|
|
|
|
|
Registry.disableRegistry();
|
|
|
|
|
}
|
|
|
|
|
Tomcat tomcat = new Tomcat();
|
|
|
|
|
File baseDir = (this.baseDirectory != null) ? this.baseDirectory
|
|
|
|
|
: createTempDir("tomcat");
|
|
|
|
@ -707,6 +713,16 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
|
|
|
|
|
this.backgroundProcessorDelay = delay;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set whether the factory should disable Tomcat's MBean registry prior to creating
|
|
|
|
|
* the server.
|
|
|
|
|
* @param disableMBeanRegistry whether to disable the MBean registry
|
|
|
|
|
* @since 2.2.0
|
|
|
|
|
*/
|
|
|
|
|
public void setDisableMBeanRegistry(boolean disableMBeanRegistry) {
|
|
|
|
|
this.disableMBeanRegistry = disableMBeanRegistry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* {@link LifecycleListener} to disable persistence in the {@link StandardManager}. A
|
|
|
|
|
* {@link LifecycleListener} is used so not to interfere with Tomcat's default manager
|
|
|
|
|