From 6123d0fcfde771c4251273645eaa3d641f24a8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Tue, 22 May 2012 12:33:31 +0200 Subject: Add getChannel() to ConnectionManager. --- same/src/main/java/com/orbekk/same/ConnectionManager.java | 3 +++ same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java | 3 ++- same/src/main/java/com/orbekk/same/TestConnectionManager.java | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'same/src/main/java/com') 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 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."); + } } -- cgit v1.2.3