Skip to content

Commit

Permalink
[breaking] servers - tomcat webserver constructor should now take a b…
Browse files Browse the repository at this point in the history
…ind interface into consideration, defaulted to 0.0.0.0
  • Loading branch information
fcamblor committed Sep 9, 2017
1 parent ad67870 commit 8f58414
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class TomcatWebServer extends WebServerBase {
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();

Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.