Updated Branches: refs/heads/CURATOR-53-2 cb1a80938 -> bd6979921
Now that the watcher tries to create the node always, the ConnectionStateListener is redundant Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/bd697992 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/bd697992 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/bd697992 Branch: refs/heads/CURATOR-53-2 Commit: bd6979921431993a0d780e4617a6e0ab1adfe8ec Parents: cb1a809 Author: randgalt <randg...@apache.org> Authored: Sun Nov 10 06:08:31 2013 -0800 Committer: randgalt <randg...@apache.org> Committed: Sun Nov 10 06:08:31 2013 -0800 ---------------------------------------------------------------------- .../recipes/nodes/PersistentEphemeralNode.java | 13 ------------- 1 file changed, 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/bd697992/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java index 60b43c8..71095ba 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java @@ -25,8 +25,6 @@ import org.apache.curator.framework.api.ACLBackgroundPathAndBytesable; import org.apache.curator.framework.api.BackgroundCallback; import org.apache.curator.framework.api.CreateModable; import org.apache.curator.framework.api.CuratorEvent; -import org.apache.curator.framework.state.ConnectionState; -import org.apache.curator.framework.state.ConnectionStateListener; import org.apache.zookeeper.CreateMode; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.WatchedEvent; @@ -70,14 +68,6 @@ public class PersistentEphemeralNode implements Closeable createNode(); } }; - private final ConnectionStateListener listener = new ConnectionStateListener() - { - @Override - public void stateChanged(CuratorFramework client, ConnectionState newState) - { - createNode(); - } - }; private final BackgroundCallback checkExistsCallback = new BackgroundCallback() { @Override @@ -236,7 +226,6 @@ public class PersistentEphemeralNode implements Closeable { Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Already started"); - client.getConnectionStateListenable().addListener(listener); createNode(); } @@ -265,8 +254,6 @@ public class PersistentEphemeralNode implements Closeable return; } - client.getConnectionStateListenable().removeListener(listener); - try { deleteNode();