diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-17 16:48:09 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-17 16:48:09 +0100 |
commit | 83213691c461d502809ecd8e7700747b511a7476 (patch) | |
tree | 3c316e87e4e9fdc3f72e0bc8ef8fd9929d91aa37 /same-android/src/main/java/com/orbekk/PingServer.java | |
parent | ce8168592043dc51227dfac158d21a45f75e7e9d (diff) |
Update android client.
– Use the SameClient code from same.
– Update dependency.
– Remove PingServer.
Diffstat (limited to 'same-android/src/main/java/com/orbekk/PingServer.java')
-rw-r--r-- | same-android/src/main/java/com/orbekk/PingServer.java | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/same-android/src/main/java/com/orbekk/PingServer.java b/same-android/src/main/java/com/orbekk/PingServer.java deleted file mode 100644 index 5df2346..0000000 --- a/same-android/src/main/java/com/orbekk/PingServer.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.orbekk; - -import org.eclipse.jetty.server.Server; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.googlecode.jsonrpc4j.JsonRpcServer; -import com.orbekk.rpc.PingService; -import com.orbekk.rpc.PingServiceImpl; -import com.orbekk.rpc.RpcHandler; - -public class PingServer { - private Server server; - private Logger logger = LoggerFactory.getLogger(getClass()); - - public PingServer(Server server) { - this.server = server; - } - - public static PingServer createPingServer(int port) { - PingService service = new PingServiceImpl(); - JsonRpcServer jsonServer = new JsonRpcServer(service, PingService.class); - - Server server = new Server(port); - RpcHandler rpcHandler = new RpcHandler(jsonServer); - server.setHandler(rpcHandler); - - return new PingServer(server); - } - - public void start() throws Exception { - logger.info("Starting server."); - server.start(); - } - - public void join() { - try { - server.join(); - } catch (InterruptedException e) { - logger.info("Received InterruptException while waiting for server.", e.fillInStackTrace()); - } - } - - public void stop() { - try { - server.stop(); - } catch (Exception e) { - logger.warn("Exception when stopping server.", e.fillInStackTrace()); - } - } -} |