From 3f4186ee2aef437f946fad717fb9ac133d3d3366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Mon, 9 Apr 2012 12:23:22 +0200 Subject: Fix bugs in ExampleServer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit – StopServer() should not cast InterruptedExeception. – Use correct Logger class. --- same/src/main/java/com/orbekk/same/benchmark/ExampleServer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'same') 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) { -- cgit v1.2.3