Merge tag 'v2.3.28' into testing
[lgpl/argeo-commons.git] / org.argeo.cms.lib.jetty / src / org / argeo / cms / jetty / JettyHttpServer.java
index 74f0aaed3d8ddeb3154585386f15a5968d8c54eb..4e91ea41c734a51f739a1d82d2d030000788fb38 100644 (file)
@@ -230,6 +230,7 @@ public class JettyHttpServer extends HttpsServer {
                        server.stop();
                        // TODO delete temp dir
                        started = false;
+                       log.debug(() -> "Stopped Jetty server");
                } catch (Exception e) {
                        log.error("Cannot stop Jetty HTTP server", e);
                }
@@ -279,7 +280,7 @@ public class JettyHttpServer extends HttpsServer {
                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
@@ -315,9 +316,16 @@ public class JettyHttpServer extends HttpsServer {
        }
 
        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() {