diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-06 21:00:19 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-06 21:00:19 +0100 |
commit | 1e8fd072ee765e70770a89970d164809e9d31a26 (patch) | |
tree | b89d1f22ec9f9511f225c22b44c705a39af10fa2 /same/src/main | |
parent | 8d19516ef4a2983f343883c29a48eacd942040ec (diff) |
Refactor: Rename classes.
Rename Client and Master classes, because the classes contain more than
just the service interfaces.
– ClientServiceImpl => Client.
– MasterServiceImpl => Master.
Diffstat (limited to 'same/src/main')
-rw-r--r-- | same/src/main/java/com/orbekk/same/Client.java (renamed from same/src/main/java/com/orbekk/same/ClientServiceImpl.java) | 4 | ||||
-rw-r--r-- | same/src/main/java/com/orbekk/same/Master.java (renamed from same/src/main/java/com/orbekk/same/MasterServiceImpl.java) | 8 | ||||
-rw-r--r-- | same/src/main/java/com/orbekk/same/Same.java | 6 | ||||
-rw-r--r-- | same/src/main/java/com/orbekk/same/SameController.java | 16 |
4 files changed, 17 insertions, 17 deletions
diff --git a/same/src/main/java/com/orbekk/same/ClientServiceImpl.java b/same/src/main/java/com/orbekk/same/Client.java index c503919..ce3947c 100644 --- a/same/src/main/java/com/orbekk/same/ClientServiceImpl.java +++ b/same/src/main/java/com/orbekk/same/Client.java @@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory; import com.orbekk.util.WorkQueue; -public class ClientServiceImpl implements DiscoveryListener { +public class Client implements DiscoveryListener { private Logger logger = LoggerFactory.getLogger(getClass()); private ConnectionManager connections; private State state; @@ -57,7 +57,7 @@ public class ClientServiceImpl implements DiscoveryListener { } }; - public ClientServiceImpl(State state, ConnectionManager connections, + public Client(State state, ConnectionManager connections, String myUrl) { this.state = state; this.connections = connections; diff --git a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java b/same/src/main/java/com/orbekk/same/Master.java index 7e25fc1..eaf0a8f 100644 --- a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java +++ b/same/src/main/java/com/orbekk/same/Master.java @@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory; import com.orbekk.same.State.Component; -public class MasterServiceImpl implements MasterService, Runnable { +public class Master implements MasterService, Runnable { private Logger logger = LoggerFactory.getLogger(getClass()); private final ConnectionManager connections; private State state; @@ -17,16 +17,16 @@ public class MasterServiceImpl implements MasterService, Runnable { private List<String> _fullStateReceivers = new ArrayList<String>(); private Thread workerThread = null; - public static MasterServiceImpl create(ConnectionManager connections, + public static Master create(ConnectionManager connections, Broadcaster broadcaster, String myUrl) { State state = new State("DefaultMaster"); state.update(".masterUrl", myUrl, 1); - return new MasterServiceImpl(state, connections, broadcaster); + return new Master(state, connections, broadcaster); } /** Constructor for internal use. */ - MasterServiceImpl(State initialState, ConnectionManager connections, + Master(State initialState, ConnectionManager connections, Broadcaster broadcaster) { this.state = initialState; this.connections = connections; diff --git a/same/src/main/java/com/orbekk/same/Same.java b/same/src/main/java/com/orbekk/same/Same.java index 69e1a0f..b152be4 100644 --- a/same/src/main/java/com/orbekk/same/Same.java +++ b/same/src/main/java/com/orbekk/same/Same.java @@ -10,7 +10,7 @@ import org.slf4j.LoggerFactory; @Deprecated public class Same implements SameInterface { private Logger logger = LoggerFactory.getLogger(getClass()); - private ClientServiceImpl client; + private Client client; private StateChangedProxy stateChangedProxy = new StateChangedProxy(); private class StateChangedProxy implements StateChangedListener { @@ -25,13 +25,13 @@ public class Same implements SameInterface { } } - public static Same createSame(ClientServiceImpl client) { + public static Same createSame(Client client) { Same same = new Same(client); client.setStateChangedListener(same.stateChangedProxy); return same; } - Same(ClientServiceImpl client) { + Same(Client client) { this.client = client; } diff --git a/same/src/main/java/com/orbekk/same/SameController.java b/same/src/main/java/com/orbekk/same/SameController.java index 44e1721..abf97c1 100644 --- a/same/src/main/java/com/orbekk/same/SameController.java +++ b/same/src/main/java/com/orbekk/same/SameController.java @@ -15,8 +15,8 @@ public class SameController { private Logger logger = LoggerFactory.getLogger(getClass()); private int port; private ServerContainer server; - private MasterServiceImpl master; - private ClientServiceImpl client; + private Master master; + private Client client; private PaxosServiceImpl paxos; /** @@ -37,10 +37,10 @@ public class SameController { String masterUrl = baseUrl + "MasterService.json"; String clientUrl = baseUrl + "ClientService.json"; - MasterServiceImpl master = MasterServiceImpl.create( + Master master = Master.create( connections, broadcaster, masterUrl); - ClientServiceImpl client = new ClientServiceImpl(state, connections, + Client client = new Client(state, connections, clientUrl); PaxosServiceImpl paxos = new PaxosServiceImpl(""); @@ -59,8 +59,8 @@ public class SameController { public SameController( int port, ServerContainer server, - MasterServiceImpl master, - ClientServiceImpl client, + Master master, + Client client, PaxosServiceImpl paxos) { this.port = port; this.server = server; @@ -103,11 +103,11 @@ public class SameController { client.joinNetwork(url); } - public ClientServiceImpl getClient() { + public Client getClient() { return client; } - public MasterServiceImpl getMaster() { + public Master getMaster() { return master; } } |