diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-09 12:23:22 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-09 12:23:22 +0200 |
commit | 3f4186ee2aef437f946fad717fb9ac133d3d3366 (patch) | |
tree | fc713851b052bf50c67beb7a561e64e7080d3732 /same/src/main/java/com/orbekk | |
parent | 45622f6c0d98c4b21375374cd748bae8e0ca1daf (diff) |
Fix bugs in ExampleServer.
– StopServer() should not cast InterruptedExeception.
– Use correct Logger class.
Diffstat (limited to 'same/src/main/java/com/orbekk')
-rw-r--r-- | same/src/main/java/com/orbekk/same/benchmark/ExampleServer.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/same/src/main/java/com/orbekk/same/benchmark/ExampleServer.java b/same/src/main/java/com/orbekk/same/benchmark/ExampleServer.java index 9aa691d..6615829 100644 --- a/same/src/main/java/com/orbekk/same/benchmark/ExampleServer.java +++ b/same/src/main/java/com/orbekk/same/benchmark/ExampleServer.java @@ -1,6 +1,6 @@ package com.orbekk.same.benchmark; -import org.apache.log4j.Logger; +import java.util.logging.Logger; import com.google.protobuf.RpcCallback; import com.google.protobuf.RpcController; @@ -9,7 +9,7 @@ import com.orbekk.same.benchmark.Example.Data; public class ExampleServer { private final static Logger logger = - Logger.getLogger(ExampleServer.class); + Logger.getLogger(ExampleServer.class.getName()); private volatile SimpleProtobufServer server; class ServiceImpl extends Example.Service { @@ -31,8 +31,9 @@ public class ExampleServer { logger.info("Running SimpleProtobufServer on port " + server.getPort()); } - public void stopServer() throws InterruptedException { + public void stopServer() { server.interrupt(); + logger.info("Server stopped."); } public static void main(String[] args) { |