diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-16 20:13:07 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-01-16 20:13:07 +0100 |
commit | 654ac153d6d260ec4cf79e614a93fbcd40dc4659 (patch) | |
tree | d5d1f3bd40a3d8b8cc41fa2d6bcbfa85b20a969a /same/src/main/java | |
parent | 080bad3ea5707021c1ae3c33abc0b0e3aca6b908 (diff) |
Implement updateStateRequest().
– Verify that states are synchronized to all clients.
Diffstat (limited to 'same/src/main/java')
-rw-r--r-- | same/src/main/java/com/orbekk/same/MasterServiceImpl.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java index 2101de8..6779702 100644 --- a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java +++ b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java @@ -78,9 +78,13 @@ public class MasterServiceImpl implements MasterService, UrlReceiver, Runnable { @Override - public boolean updateStateRequest(String component, String newData, long revision) { - // TODO Auto-generated method stub - return false; + public synchronized boolean updateStateRequest(String component, + String newData, long revision) { + boolean updated = state.update(component, newData, revision); + if (updated) { + notifyAll(); + } + return updated; } @Override |