类 TomcatWebServer
- java.lang.Object
- org.springframework.boot.web.embedded.tomcat.TomcatWebServer
- 所有已实现的接口:
WebServer
public class TomcatWebServer extends Object implements WebServer
WebServer
that can be used to control a Tomcat web server. Usually this class should be created using theTomcatReactiveWebServerFactory
ofTomcatServletWebServerFactory
, but not directly.- 从以下版本开始:
- 2.0.0
构造器概要
构造器 构造器 说明 TomcatWebServer(org.apache.catalina.startup.Tomcat tomcat)
Create a newTomcatWebServer
instance.TomcatWebServer(org.apache.catalina.startup.Tomcat tomcat, boolean autoStart)
Create a newTomcatWebServer
instance.
构造器详细资料
TomcatWebServer
public TomcatWebServer(org.apache.catalina.startup.Tomcat tomcat)
Create a newTomcatWebServer
instance.- 参数:
tomcat
- the underlying Tomcat server
TomcatWebServer
public TomcatWebServer(org.apache.catalina.startup.Tomcat tomcat, boolean autoStart)
Create a newTomcatWebServer
instance.- 参数:
tomcat
- the underlying Tomcat serverautoStart
- if the server should be started
方法详细资料
start
public void start() throws WebServerException
从接口复制的说明:WebServer
Starts the web server. Calling this method on an already started server has no effect.- 指定者:
start
在接口中WebServer
- 抛出:
WebServerException
- if the server cannot be started
stop
public void stop() throws WebServerException
从接口复制的说明:WebServer
Stops the web server. Calling this method on an already stopped server has no effect.- 指定者:
stop
在接口中WebServer
- 抛出:
WebServerException
- if the server cannot be stopped
getTomcat
public org.apache.catalina.startup.Tomcat getTomcat()
Returns access to the underlying Tomcat server.- 返回:
- the Tomcat server