public interface WebApplicationServer
A handle that provides lifecycle methods to a web application server.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(WebApplicationServerListener listener) Adds a listener to various eventsReturns the configuration for this web application server.intgetPort()Get the local port the server is listening on for client connections.voidremoveListener(WebApplicationServerListener listener) Removes a listener to various eventsvoidstart()Starts the servervoidstop()Stops the server if the server fails to stop
-
Method Details
-
start
Starts the server- Throws:
Exception- if the server fails to start
-
stop
Stops the server if the server fails to stop- Throws:
Exception
-
getConfiguration
WebApplicationConfig getConfiguration()Returns the configuration for this web application server.- Returns:
- the configuration
-
addListener
Adds a listener to various events- Parameters:
listener- the listener to add
-
removeListener
Removes a listener to various events- Parameters:
listener- the listener to add
-
getPort
int getPort()Get the local port the server is listening on for client connections. This allows returning the ephemeral port that the server is using if ephemeral ports are supported.- Returns:
- socket port
-