diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-03-06 14:50:23 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-03-06 14:50:23 +0100 |
commit | b795cc1519d88a22d3d3a05d5a41e278b6ccf617 (patch) | |
tree | f4da4f3db8fa05dfa4c4bfb0d257a6f8329b26bb /same/src/main/java/com/orbekk/same/SameController.java | |
parent | 64f187d46f8ac97e4cfb400f52562f8bb53275be (diff) |
Add tools used with the Directory service.
Diffstat (limited to 'same/src/main/java/com/orbekk/same/SameController.java')
-rw-r--r-- | same/src/main/java/com/orbekk/same/SameController.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/same/src/main/java/com/orbekk/same/SameController.java b/same/src/main/java/com/orbekk/same/SameController.java index 6f32bf6..7f45592 100644 --- a/same/src/main/java/com/orbekk/same/SameController.java +++ b/same/src/main/java/com/orbekk/same/SameController.java @@ -10,6 +10,7 @@ import com.orbekk.net.DefaultBroadcasterFactory; import com.orbekk.paxos.PaxosService; import com.orbekk.paxos.PaxosServiceImpl; import com.orbekk.same.config.Configuration; +import com.orbekk.same.discovery.DirectoryService; import com.orbekk.same.discovery.DiscoveryService; import com.orbekk.same.http.ServerContainer; import com.orbekk.same.http.StateServlet; @@ -25,6 +26,7 @@ public class SameController { private DiscoveryService discoveryService; private BroadcasterFactory broadcasterFactory; private Configuration configuration; + private ConnectionManager connections; /** * Timeout for remote operations in milliseconds. @@ -70,7 +72,7 @@ public class SameController { .build(); SameController controller = new SameController( - configuration, server, master, client, + configuration, connections, server, master, client, paxos, discoveryService, broadcasterFactory); return controller; } @@ -81,6 +83,7 @@ public class SameController { public SameController( Configuration configuration, + ConnectionManager connections, ServerContainer server, Master master, Client client, @@ -88,6 +91,7 @@ public class SameController { DiscoveryService discoveryService, BroadcasterFactory broadcasterFactory) { this.configuration = configuration; + this.connections = connections; this.server = server; this.master = master; this.client = client; @@ -153,6 +157,15 @@ public class SameController { public Master getMaster() { return master; } + + public DirectoryService getDirectory() { + String directoryUrl = configuration.get("directoryUrl"); + DirectoryService directory = null; + if (directoryUrl != null) { + directory = connections.getDirectory(directoryUrl); + } + return directory; + } public VariableFactory createVariableFactory() { return new VariableFactory(client.getInterface()); |