summaryrefslogtreecommitdiff
path: root/same/src/main
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-16 21:32:48 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-16 21:32:48 +0100
commit3954fd70274cb175394a5060f251331a96d9dc8b (patch)
tree84cc74921e8e40c30fc627dfe5e265454b5908a5 /same/src/main
parent489cd721117cdc5b66bbe3bc180bdfab7aaae301 (diff)
Fix full state update to new clients.
Diffstat (limited to 'same/src/main')
-rw-r--r--same/src/main/java/com/orbekk/same/MasterServiceImpl.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java
index 729c0ba..d7a9e53 100644
--- a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java
+++ b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java
@@ -28,10 +28,11 @@ public class MasterServiceImpl implements MasterService, UrlReceiver, Runnable {
List<String> participants = participants();
if (!participants.contains(clientUrl)) {
participants.add(clientUrl);
+ _fullStateReceivers.add(clientUrl);
synchronized(this) {
- notifyAll();
state.updateFromObject(".participants", participants,
state.getRevision(".participants"));
+ notifyAll();
}
} else {
logger.warn("Client {} already part of network. " +
@@ -58,7 +59,7 @@ public class MasterServiceImpl implements MasterService, UrlReceiver, Runnable {
boolean hasWork = _fullStateReceivers.size() != 0;
if (hasWork) {
final List<State.Component> components = state.getComponents();
- broadcaster.broadcast(participants(), new ServiceOperation() {
+ broadcaster.broadcast(_fullStateReceivers, new ServiceOperation() {
@Override public void run(ClientService client) {
for (Component c : components) {
client.setState(c.getName(), c.getData(), c.getRevision());