Permalink
Browse files

[breaking] servers - removing SimpleWebServer's constructor & builder…

… serverId useless field
  • Loading branch information...
fcamblor committed Aug 24, 2017
1 parent 6b20ac6 commit f24469d24fd10cc408173e26de3a95ac188e16bc
Showing with 3 additions and 13 deletions.
  1. +3 −13 restx-server-simple/src/main/java/restx/server/simple/simple/SimpleWebServer.java
@@ -33,7 +33,6 @@
private int port;
private String routerPath = "/api";
private String appBase = null;
private String serverId;
private RestxMainRouter router;
public SimpleWebServerBuilder setPort(int port) {
this.port = port;
@@ -50,23 +49,14 @@ public SimpleWebServerBuilder setAppBase(String appBase) {
return this;
}
public SimpleWebServerBuilder setServerId(String serverId) {
this.serverId = serverId;
return this;
}
public SimpleWebServerBuilder setRouter(RestxMainRouter router) {
this.router = router;
return this;
}
public SimpleWebServer build() {
if (serverId == null) {
serverId = "SimpleWebServer#" + SERVER_ID.incrementAndGet();
}
if (router == null) {
return new SimpleWebServer(serverId, routerPath, appBase, port) {
return new SimpleWebServer(routerPath, appBase, port) {
@Override
protected RestxMainRouter setupRouter() {
return RestxMainRouterFactory.newInstance(
@@ -82,7 +72,7 @@ public synchronized void stop() throws Exception {
}
};
} else {
return new SimpleWebServer(serverId, routerPath, appBase, port) {
return new SimpleWebServer(routerPath, appBase, port) {
@Override
protected RestxMainRouter setupRouter() {
return router;
@@ -104,7 +94,7 @@ public static SimpleWebServerBuilder builder() {
private RestxMainRouter router;
private Connection connection;
private SimpleWebServer(String serverId, String routerPath, String appBase, int port) {
private SimpleWebServer(String routerPath, String appBase, int port) {
super(appBase, port, "localhost", "SimpleFrameowkr", "org.simpleframework", "simple");
this.routerPath = routerPath;

0 comments on commit f24469d

Please sign in to comment.