diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-05-22 12:33:31 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-05-22 12:33:31 +0200 |
commit | 6123d0fcfde771c4251273645eaa3d641f24a8c9 (patch) | |
tree | ef3ea49d1f23ef01ab9b03cfca5192138de0384d | |
parent | c10d6e581f3df60c6a9cf89214c18017c0505586 (diff) |
Add getChannel() to ConnectionManager.
3 files changed, 11 insertions, 1 deletions
diff --git a/same/src/main/java/com/orbekk/same/ConnectionManager.java b/same/src/main/java/com/orbekk/same/ConnectionManager.java index 27560ca..895a6f5 100644 --- a/same/src/main/java/com/orbekk/same/ConnectionManager.java +++ b/same/src/main/java/com/orbekk/same/ConnectionManager.java @@ -15,6 +15,8 @@ */ package com.orbekk.same; +import com.orbekk.protobuf.RpcChannel; + /** * An interface that returns a connection for a participant. * @@ -25,4 +27,5 @@ public interface ConnectionManager { Services.Client getClient0(String location); Services.Directory getDirectory(String location); Services.Paxos getPaxos0(String location); + RpcChannel getChannel(String location); } diff --git a/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java b/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java index 0f5cf00..dd0288c 100644 --- a/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java +++ b/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java @@ -65,7 +65,8 @@ public class ConnectionManagerImpl implements ConnectionManager { return true; } - private RpcChannel getChannel(String location) { + @Override + public RpcChannel getChannel(String location) { Future<RpcChannel> channel = channels.get(location); if (channel == null) { if (!isValidLocation(location)) { diff --git a/same/src/main/java/com/orbekk/same/TestConnectionManager.java b/same/src/main/java/com/orbekk/same/TestConnectionManager.java index 27b41b2..609b1c7 100644 --- a/same/src/main/java/com/orbekk/same/TestConnectionManager.java +++ b/same/src/main/java/com/orbekk/same/TestConnectionManager.java @@ -18,6 +18,7 @@ package com.orbekk.same; import java.util.Map; import java.util.HashMap; +import com.orbekk.protobuf.RpcChannel; import com.orbekk.same.Services.Directory; import com.orbekk.same.Services.Master; import com.orbekk.same.Services.Paxos; @@ -57,4 +58,9 @@ public class TestConnectionManager implements ConnectionManager { public Services.Paxos getPaxos0(String location) { return paxosMap0.get(location); } + + @Override + public RpcChannel getChannel(String location) { + throw new RuntimeException("Not implemented."); + } } |