server.stop();
// TODO delete temp dir
started = false;
+ log.debug(() -> "Stopped Jetty server");
} catch (Exception e) {
log.error("Cannot stop Jetty HTTP server", e);
}
if (httpContext instanceof ContextHandlerHttpContext contextHandlerHttpContext) {
// TODO stop handler first?
// FIXME understand compatibility with Jetty 12
- //contextHandlerCollection.removeHandler(contextHandlerHttpContext.getServletContextHandler());
+ // contextHandlerCollection.removeHandler(contextHandlerHttpContext.getServletContextHandler());
} else {
// FIXME apparently servlets cannot be removed in Jetty, we should replace the
// handler
}
private String httpPortsMsg() {
+ String hostStr = getHost();
+ hostStr = hostStr == null ? "*:" : hostStr + ":";
+ return (httpConnector != null ? "# HTTP " + hostStr + getHttpPort() + " " : "")
+ + (httpsConnector != null ? "# HTTPS " + hostStr + getHttpsPort() : "");
+ }
- return (httpConnector != null ? "HTTP " + getHttpPort() + " " : "")
- + (httpsConnector != null ? "HTTPS " + getHttpsPort() : "");
+ public String getHost() {
+ if (httpConnector == null)
+ return null;
+ return httpConnector.getHost();
}
public Integer getHttpPort() {