summaryrefslogtreecommitdiff
path: root/same/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'same/src/main/java/com')
-rw-r--r--same/src/main/java/com/orbekk/same/ConnectionManager.java3
-rw-r--r--same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java7
-rw-r--r--same/src/main/java/com/orbekk/same/TestConnectionManager.java10
3 files changed, 19 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 aa4151e..a6d0914 100644
--- a/same/src/main/java/com/orbekk/same/ConnectionManager.java
+++ b/same/src/main/java/com/orbekk/same/ConnectionManager.java
@@ -1,5 +1,7 @@
package com.orbekk.same;
+import com.orbekk.paxos.PaxosService;
+
/**
* An interface that returns a connection for a participant.
*
@@ -8,4 +10,5 @@ package com.orbekk.same;
public interface ConnectionManager {
ClientService getClient(String url);
MasterService getMaster(String url);
+ PaxosService getPaxos(String url);
}
diff --git a/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java b/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java
index f74bca7..588397d 100644
--- a/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java
+++ b/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java
@@ -2,6 +2,8 @@ package com.orbekk.same;
import com.googlecode.jsonrpc4j.JsonRpcHttpClient;
import com.googlecode.jsonrpc4j.ProxyUtil;
+import com.orbekk.paxos.PaxosService;
+
import java.net.MalformedURLException;
import java.net.URL;
import org.slf4j.Logger;
@@ -47,4 +49,9 @@ public class ConnectionManagerImpl implements ConnectionManager {
public MasterService getMaster(String url) {
return getClassProxy(url, MasterService.class);
}
+
+ @Override
+ public PaxosService getPaxos(String url) {
+ return getClassProxy(url, PaxosService.class);
+ }
}
diff --git a/same/src/main/java/com/orbekk/same/TestConnectionManager.java b/same/src/main/java/com/orbekk/same/TestConnectionManager.java
index 4e26894..3439a78 100644
--- a/same/src/main/java/com/orbekk/same/TestConnectionManager.java
+++ b/same/src/main/java/com/orbekk/same/TestConnectionManager.java
@@ -3,6 +3,8 @@ package com.orbekk.same;
import java.util.Map;
import java.util.HashMap;
+import com.orbekk.paxos.PaxosService;
+
/**
* This class is used in test.
*/
@@ -10,7 +12,9 @@ public class TestConnectionManager implements ConnectionManager {
public Map<String, ClientService> clientMap =
new HashMap<String, ClientService>();
public Map<String, MasterService> masterMap =
- new HashMap<String, MasterService>();
+ new HashMap<String, MasterService>();
+ public Map<String, PaxosService> paxosMap =
+ new HashMap<String, PaxosService>();
public TestConnectionManager() {
}
@@ -22,4 +26,8 @@ public class TestConnectionManager implements ConnectionManager {
public MasterService getMaster(String url) {
return masterMap.get(url);
}
+
+ public PaxosService getPaxos(String url) {
+ return paxosMap.get(url);
+ }
}