diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-27 16:33:01 +0100 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-02-27 16:33:01 +0100 |
commit | db6fb088c220d8c313aa8d2d3bdc1708ad7acf5a (patch) | |
tree | 9abc8d96a411c70c65eec3e8748d7db6bf2733a2 /same/src/main/java/com/orbekk/same/VariableFactory.java | |
parent | 145b1bd126603219dfe50b739dd3a019b43e5972 (diff) |
Use DelayedOperation in ClientInterface.
Diffstat (limited to 'same/src/main/java/com/orbekk/same/VariableFactory.java')
-rw-r--r-- | same/src/main/java/com/orbekk/same/VariableFactory.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/same/src/main/java/com/orbekk/same/VariableFactory.java b/same/src/main/java/com/orbekk/same/VariableFactory.java index f1796d6..fa9eeeb 100644 --- a/same/src/main/java/com/orbekk/same/VariableFactory.java +++ b/same/src/main/java/com/orbekk/same/VariableFactory.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.orbekk.same.State.Component; +import com.orbekk.util.DelayedOperation; /** * TODO: Use WeakReference in order to make variables GC-able. @@ -37,12 +38,12 @@ public class VariableFactory { } @Override - public void set(T value) throws UpdateConflict { + public DelayedOperation set(T value) { try { String serializedValue = mapper.writeValueAsString(value); State.Component update = new State.Component(identifier, revision, serializedValue); - client.set(update); + return client.set(update); } catch (JsonGenerationException e) { logger.warn("Failed to convert to JSON: {}", value); logger.warn("Parse exception.", e); |