summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/orbekk/example/ExampleClient.java6
-rw-r--r--src/main/java/com/orbekk/protobuf/RpcChannel.java (renamed from src/main/java/com/orbekk/protobuf/NewRpcChannel.java)12
-rw-r--r--src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java8
3 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/com/orbekk/example/ExampleClient.java b/src/main/java/com/orbekk/example/ExampleClient.java
index e047ad9..4d229fe 100644
--- a/src/main/java/com/orbekk/example/ExampleClient.java
+++ b/src/main/java/com/orbekk/example/ExampleClient.java
@@ -19,14 +19,14 @@ import java.util.concurrent.CountDownLatch;
import com.google.protobuf.RpcCallback;
import com.orbekk.example.Example.FortuneReply;
-import com.orbekk.protobuf.NewRpcChannel;
+import com.orbekk.protobuf.RpcChannel;
import com.orbekk.protobuf.Rpc;
public class ExampleClient {
public void runClient(int port) {
- NewRpcChannel channel = null;
+ RpcChannel channel = null;
try {
- channel = NewRpcChannel.createOrNull("localhost", port);
+ channel = RpcChannel.createOrNull("localhost", port);
Example.FortuneService service =
Example.FortuneService.newStub(channel);
printFortune(service);
diff --git a/src/main/java/com/orbekk/protobuf/NewRpcChannel.java b/src/main/java/com/orbekk/protobuf/RpcChannel.java
index 12f1433..402ff17 100644
--- a/src/main/java/com/orbekk/protobuf/NewRpcChannel.java
+++ b/src/main/java/com/orbekk/protobuf/RpcChannel.java
@@ -21,10 +21,10 @@ import com.google.protobuf.Message;
import com.google.protobuf.RpcCallback;
import com.google.protobuf.RpcController;
-public class NewRpcChannel implements com.google.protobuf.RpcChannel {
+public class RpcChannel implements com.google.protobuf.RpcChannel {
public static int NUM_CONCURRENT_REQUESTS = 5;
private static final Logger logger =
- Logger.getLogger(NewRpcChannel.class.getName());
+ Logger.getLogger(RpcChannel.class.getName());
private final String host;
private final int port;
private final AtomicLong nextId = new AtomicLong(0);
@@ -142,7 +142,7 @@ public class NewRpcChannel implements com.google.protobuf.RpcChannel {
}
}
- public static NewRpcChannel createOrNull(String host, int port) {
+ public static RpcChannel createOrNull(String host, int port) {
try {
return create(host, port);
} catch (UnknownHostException e) {
@@ -154,14 +154,14 @@ public class NewRpcChannel implements com.google.protobuf.RpcChannel {
}
}
- public static NewRpcChannel create(String host, int port)
+ public static RpcChannel create(String host, int port)
throws UnknownHostException, IOException {
- NewRpcChannel channel = new NewRpcChannel(host, port);
+ RpcChannel channel = new RpcChannel(host, port);
channel.start();
return channel;
}
- NewRpcChannel(String host, int port) {
+ RpcChannel(String host, int port) {
this.host = host;
this.port = port;
}
diff --git a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java
index 1f1bc46..bf30f59 100644
--- a/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java
+++ b/src/test/java/com/orbekk/protobuf/ProtobufFunctionalTest.java
@@ -35,12 +35,12 @@ public class ProtobufFunctionalTest {
CountDownLatch returnC = new CountDownLatch(1);
SimpleProtobufServer server = SimpleProtobufServer.create(0, 50, 1);
int serverport = server.getPort();
- NewRpcChannel channel;
+ RpcChannel channel;
TestService directService = new TestService();
Test.Service service;
@Before public void setUp() throws Exception {
- channel = NewRpcChannel.create("localhost", serverport);
+ channel = RpcChannel.create("localhost", serverport);
service = Test.Service.newStub(channel);
server.start();
server.registerService(directService);
@@ -79,7 +79,7 @@ public class ProtobufFunctionalTest {
}
@org.junit.Test public void testNewRpcChannel() throws Exception {
- NewRpcChannel channel = NewRpcChannel.create("localhost", serverport);
+ RpcChannel channel = RpcChannel.create("localhost", serverport);
Test.Service service = Test.Service.newStub(channel);
Test.Type1 request = Test.Type1.newBuilder().build();
int count = 10000;
@@ -100,7 +100,7 @@ public class ProtobufFunctionalTest {
}
@org.junit.Test public void testDoneSignal() throws Exception {
- NewRpcChannel channel = NewRpcChannel.create("localhost", serverport);
+ RpcChannel channel = RpcChannel.create("localhost", serverport);
Test.Service service = Test.Service.newStub(channel);
Test.Type1 request = Test.Type1.newBuilder().build();