Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/rest/Standalone.java @ 562:05caf2e731d0
Allow to add additional restful services via configuration.
author | gernotbelger |
---|---|
date | Wed, 10 Oct 2018 20:07:58 +0200 |
parents | 415df0fc4fa1 |
children |
comparison
equal
deleted
inserted
replaced
561:1c2ce0501305 | 562:05caf2e731d0 |
---|---|
87 } | 87 } |
88 | 88 |
89 listen = XMLUtils.xpathString(document, LISTEN_INTERFACE, null); | 89 listen = XMLUtils.xpathString(document, LISTEN_INTERFACE, null); |
90 maxThreads = XMLUtils.xpathString(document, MAX_THREADS, null); | 90 maxThreads = XMLUtils.xpathString(document, MAX_THREADS, null); |
91 } | 91 } |
92 | |
93 @Override | |
94 public String getServerAddress() { | |
95 String host = (this.listen == null || this.listen.trim().length() == 0 ) ? "localhost" : this.listen; | |
96 return String.format("http://%s:%d", host, this.port); | |
97 } | |
92 | 98 |
93 protected Server createServer() { | 99 protected Server createServer() { |
94 return listen != null && listen.length() > 0 | 100 return listen != null && listen.length() > 0 |
95 ? new Server(Protocol.HTTP, listen, port) | 101 ? new Server(Protocol.HTTP, listen, port) |
96 : new Server(Protocol.HTTP, port); | 102 : new Server(Protocol.HTTP, port); |