|
|
@@ -4,7 +4,7 @@ import java.net.{InetAddress, InetSocketAddress}
|
|
|
import javax.servlet.ServletContextListener
|
|
|
|
|
|
import ch.qos.logback.access.jetty.RequestLogImpl
|
|
|
-import org.eclipse.jetty.server.Server
|
|
|
+import org.eclipse.jetty.server.{NetworkConnector, Server}
|
|
|
import org.eclipse.jetty.server.handler.{HandlerCollection, RequestLogHandler}
|
|
|
import org.eclipse.jetty.servlet.{ServletContextHandler, DefaultServlet}
|
|
|
import org.scalatra.servlet.AsyncSupport
|
|
|
@@ -15,7 +15,7 @@ class WebServer(var host: String, var port: Int) extends Logging {
|
|
|
val address = new InetSocketAddress(host, port)
|
|
|
val server = new Server(address)
|
|
|
|
|
|
- server.setGracefulShutdown(1000)
|
|
|
+ server.setStopTimeout(1000)
|
|
|
server.setStopAtShutdown(true)
|
|
|
|
|
|
val context = new ServletContextHandler()
|
|
|
@@ -45,9 +45,8 @@ class WebServer(var host: String, var port: Int) extends Logging {
|
|
|
def start() = {
|
|
|
server.start()
|
|
|
|
|
|
- val connector = server.getConnectors()(0)
|
|
|
+ val connector = server.getConnectors()(0).asInstanceOf[NetworkConnector]
|
|
|
|
|
|
- host = connector.getHost
|
|
|
if (host == "0.0.0.0") {
|
|
|
host = InetAddress.getLocalHost.getHostAddress
|
|
|
}
|