Permalink
Browse files

[breaking] servers - tomcat webserver constructor should now take a b…

…ind interface into consideration, defaulted to 0.0.0.0
  • Loading branch information...
fcamblor committed Aug 24, 2017
1 parent ad67870 commit 8f58414c81e6f154c565ba9a81e956e6a79c6c9e
@@ -22,8 +22,8 @@
private final Tomcat tomcat;
private final Context context;
public TomcatWebServer(String appBase, int port) throws ServletException {
super(checkNotNull(appBase), port, "localhost", "Apache Tomcat", "org.apache.tomcat", "tomcat-catalina");
public TomcatWebServer(String appBase, int port, String bindInterface) throws ServletException {
super(checkNotNull(appBase), port, bindInterface, "Apache Tomcat", "org.apache.tomcat", "tomcat-catalina");
tomcat = new Tomcat();
@@ -58,12 +58,12 @@ protected void _stop() throws LifecycleException {
tomcat.stop();
}
public static WebServerSupplier tomcatWebServerSupplier(final String appBase) {
public static WebServerSupplier tomcatWebServerSupplier(final String appBase, final String bindInterface) {
return new WebServerSupplier() {
@Override
public WebServer newWebServer(int port) {
try {
return new TomcatWebServer(appBase, port);
return new TomcatWebServer(appBase, port, bindInterface);
} catch (ServletException e) {
throw Throwables.propagate(e);
}
@@ -20,6 +20,6 @@ public String restxServerTomcatAppBaseDefaultLocation() {
@Provides
@Named("restx.server.tomcat")
public WebServerSupplier tomcatWebServerSupplier(@Named("restx.server.tomcat.appbase.default.location") String appBase){
return TomcatWebServer.tomcatWebServerSupplier(appBase);
return TomcatWebServer.tomcatWebServerSupplier(appBase, "0.0.0.0");
}
}

0 comments on commit 8f58414

Please sign in to comment.