Interface WebServer
- All Known Implementing Classes:
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
.- Since:
- 2.0.0
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getPort()
Return the port this server is listening on.void
start()
Starts the web server.void
stop()
Stops the web server.
Method Detail
start
void start() throws WebServerException
Starts the web server. Calling this method on an already started server has no effect.- Throws:
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.- Throws:
WebServerException
- if the server cannot be stopped
getPort
int getPort()
Return the port this server is listening on.- Returns:
- the port (or -1 if none)