diff options
Diffstat (limited to 'same/src/main/java/com')
-rw-r--r-- | same/src/main/java/com/orbekk/same/ClientServiceImpl.java | 8 | ||||
-rw-r--r-- | same/src/main/java/com/orbekk/same/SameController.java | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/same/src/main/java/com/orbekk/same/ClientServiceImpl.java b/same/src/main/java/com/orbekk/same/ClientServiceImpl.java index b46dbfb..92482d5 100644 --- a/same/src/main/java/com/orbekk/same/ClientServiceImpl.java +++ b/same/src/main/java/com/orbekk/same/ClientServiceImpl.java @@ -1,5 +1,7 @@ package com.orbekk.same; +import static com.orbekk.same.StackTraceUtil.throwableToString; + import org.codehaus.jackson.type.TypeReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -108,13 +110,15 @@ public class ClientServiceImpl implements ClientService, UrlReceiver, @Override public void discover(String url) { + String clientUrl = url + "ClientService.json"; if (!url.equals(myUrl)) { try { - connections.getClient(url + "/ClientService.json") + connections.getClient(clientUrl) .notifyNetwork(state.getDataOf(".networkName"), state.getDataOf(".masterUrl")); } catch (Exception e) { - logger.warn("Failed to contact new client {}", url, e); + logger.warn("Failed to contact new client {}: {}", clientUrl, + throwableToString(e)); } } } diff --git a/same/src/main/java/com/orbekk/same/SameController.java b/same/src/main/java/com/orbekk/same/SameController.java index d7cc747..0601547 100644 --- a/same/src/main/java/com/orbekk/same/SameController.java +++ b/same/src/main/java/com/orbekk/same/SameController.java @@ -69,10 +69,10 @@ public class SameController implements UrlReceiver { public void stop() { try { + master.interrupt(); server.stop(); } catch (Exception e) { logger.error("Failed to stop webserver", e); - master.interrupt(); } } @@ -122,4 +122,11 @@ public class SameController implements UrlReceiver { } } + public ClientServiceImpl getClient() { + return client; + } + + public MasterServiceImpl getMaster() { + return master; + } } |