From e6a2fe124bd1c3c2dc70c4182e4ec4094df95677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Tue, 27 Mar 2012 10:42:34 +0200 Subject: Change same-android to work with new Same version. --- same/src/main/java/com/orbekk/same/Master.java | 4 ++++ same/src/main/java/com/orbekk/same/SameController.java | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'same') diff --git a/same/src/main/java/com/orbekk/same/Master.java b/same/src/main/java/com/orbekk/same/Master.java index ade0b1e..529d729 100644 --- a/same/src/main/java/com/orbekk/same/Master.java +++ b/same/src/main/java/com/orbekk/same/Master.java @@ -30,6 +30,10 @@ public class Master { this.myUrl = myUrl; } + public String getUrl() { + return myUrl; + } + private MasterService serviceImpl = new MasterService() { @Override public boolean updateStateRequest(String component, diff --git a/same/src/main/java/com/orbekk/same/SameController.java b/same/src/main/java/com/orbekk/same/SameController.java index 95b8c29..8c17807 100644 --- a/same/src/main/java/com/orbekk/same/SameController.java +++ b/same/src/main/java/com/orbekk/same/SameController.java @@ -58,31 +58,22 @@ public class SameController { timeout, timeout); State clientState = new State(".InvalidClientNetwork"); Broadcaster broadcaster = BroadcasterImpl.getDefaultBroadcastRunner(); - String baseUrl = String.format("http://%s:%s/", configuration.get("localIp"), configuration.getInt("port")); - - String masterUrl = baseUrl + "MasterService.json"; String clientUrl = baseUrl + "ClientService.json"; MasterServiceProxy master = new MasterServiceProxy(); -// Master master = Master.create(connections, broadcaster, -// masterUrl, configuration.get("networkName")); - Client client = new Client(clientState, connections, clientUrl, BroadcasterImpl.getDefaultBroadcastRunner()); PaxosServiceImpl paxos = new PaxosServiceImpl(""); - StateServlet stateServlet = new StateServlet(client.getInterface(), new VariableFactory(client.getInterface())); - ServerContainer server = new JettyServerBuilder(port) .withServlet(stateServlet, "/_/state") .withService(client.getService(), ClientService.class) .withService(master, MasterService.class) .withService(paxos, PaxosService.class) .build(); - SameController controller = new SameController( configuration, connections, server, master, client, paxos, broadcaster); -- cgit v1.2.3