#65 daemon mode default output

This commit is contained in:
Andreas Penski (init) 2020-08-13 15:59:20 +02:00
parent f4509fd097
commit 8aa93158d1
3 changed files with 23 additions and 13 deletions

View file

@ -44,16 +44,18 @@ public class Daemon {
/**
* Create a new daemon.
*
* @param hostname the interface to bind to
* @param port the port to expose
* @param threadCount the number of working threads
*/
public Daemon(final String hostname, final int port, final int threadCount) {
this.bindAddress = hostname;
this.port = port;
this.port = port;
this.threadCount = threadCount;
}
/**
* Methode zum Starten des Servers
*
@ -73,9 +75,7 @@ public class Daemon {
server.setExecutor(createExecutor());
server.start();
log.info("Server {} started", server.getAddress());
if (!log.isInfoEnabled()) {
writeOut("Server {0} started", server.getAddress());
}
writeOut("Daemon started. Visit http://{0}", this.bindAddress + ":" + this.port);
} catch (final IOException e) {
log.error("Error starting HttpServer for Valdidator: {}", e.getMessage(), e);
}
@ -101,4 +101,8 @@ public class Daemon {
private InetSocketAddress getSocket() {
return new InetSocketAddress(defaultIfBlank(this.bindAddress, DEFAULT_HOST), this.port > 0 ? this.port : DEFAULT_PORT);
}
public static void shutdown() {
System.out.println("bla");
}
}