refactoring
This commit is contained in:
parent
425149f0a8
commit
d08f2a4e0c
|
@ -18,6 +18,7 @@ import org.jetbrains.annotations.NotNull;
|
||||||
import org.takes.Take;
|
import org.takes.Take;
|
||||||
import org.takes.facets.fork.FkRegex;
|
import org.takes.facets.fork.FkRegex;
|
||||||
import org.takes.facets.fork.TkFork;
|
import org.takes.facets.fork.TkFork;
|
||||||
|
import org.takes.http.Front;
|
||||||
import org.takes.http.FtBasic;
|
import org.takes.http.FtBasic;
|
||||||
import org.takes.rs.RsHtml;
|
import org.takes.rs.RsHtml;
|
||||||
import org.takes.rs.RsJson;
|
import org.takes.rs.RsJson;
|
||||||
|
@ -101,8 +102,7 @@ public class Backend implements Closeable {
|
||||||
try {
|
try {
|
||||||
log.info("Starting http backend on " + httpPort);
|
log.info("Starting http backend on " + httpPort);
|
||||||
try {
|
try {
|
||||||
new FtBasic(
|
Take forkTake = new TkFork(showOnlineControllers,
|
||||||
new TkFork(showOnlineControllers,
|
|
||||||
showOnlineApplications,
|
showOnlineApplications,
|
||||||
new Monitoring(this).showStatistics,
|
new Monitoring(this).showStatistics,
|
||||||
new FkRegex(ProxyClient.VERSION_PATH, ProxyClient.BACKEND_VERSION),
|
new FkRegex(ProxyClient.VERSION_PATH, ProxyClient.BACKEND_VERSION),
|
||||||
|
@ -116,8 +116,9 @@ public class Backend implements Closeable {
|
||||||
"<br/><br/><br/><a href='" + ProxyClient.LIST_CONTROLLERS_PATH + "'>Controllers</a>\n" +
|
"<br/><br/><br/><a href='" + ProxyClient.LIST_CONTROLLERS_PATH + "'>Controllers</a>\n" +
|
||||||
"<br/><br/><br/><a href='" + ProxyClient.LIST_APPLICATIONS_PATH + "'>Applications</a>\n" +
|
"<br/><br/><br/><a href='" + ProxyClient.LIST_APPLICATIONS_PATH + "'>Applications</a>\n" +
|
||||||
"</body></html>\n"))
|
"</body></html>\n"))
|
||||||
), httpPort
|
);
|
||||||
).start(() -> isClosed);
|
Front frontEnd = new FtBasic(forkTake, httpPort);
|
||||||
|
frontEnd.start(() -> isClosed);
|
||||||
} catch (BindException e) {
|
} catch (BindException e) {
|
||||||
throw new IllegalStateException("While binding " + httpPort, e);
|
throw new IllegalStateException("While binding " + httpPort, e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue