接口 WebServer
- 所有已知实现类:
JettyWebServer
,NettyWebServer
,TomcatWebServer
,UndertowServletWebServer
,UndertowWebServer
public interface WebServer
Simple interface that represents a fully configured web server (for example Tomcat, Jetty, Netty). Allows the server to bestarted
andstopped
.- 从以下版本开始:
- 2.0.0
方法详细资料
start
void start() throws WebServerException
Starts the web server. Calling this method on an already started server has no effect.- 抛出:
WebServerException
- if the server cannot be started
stop
void stop() throws WebServerException
Stops the web server. Calling this method on an already stopped server has no effect.- 抛出:
WebServerException
- if the server cannot be stopped
getPort
int getPort()
Return the port this server is listening on.- 返回:
- the port (or -1 if none)