You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/03/06 12:47:28 UTC
git commit: more doc
Repository: curator
Updated Branches:
refs/heads/master 0f328c6cb -> 7f2273774
more doc
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/7f227377
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/7f227377
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/7f227377
Branch: refs/heads/master
Commit: 7f22737744db1781bce8c0d55d058dfa29f9a997
Parents: 0f328c6
Author: randgalt <ra...@apache.org>
Authored: Thu Mar 6 06:47:23 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu Mar 6 06:47:23 2014 -0500
----------------------------------------------------------------------
.../curator/framework/recipes/leader/LeaderLatch.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/7f227377/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
index 8603297..d419b98 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java
@@ -102,7 +102,7 @@ public class LeaderLatch implements Closeable
public enum CloseMode
{
/**
- * When the latch is closed, listeners will *not* be notified
+ * When the latch is closed, listeners will *not* be notified (default behavior)
*/
SILENT,
@@ -168,7 +168,7 @@ public class LeaderLatch implements Closeable
@Override
public void close() throws IOException
{
- close(this.closeMode);
+ close(closeMode);
}
/**
@@ -197,16 +197,21 @@ public class LeaderLatch implements Closeable
{
client.getConnectionStateListenable().removeListener(listener);
- switch(closeMode)
+ switch ( closeMode )
{
case NOTIFY_LEADER:
+ {
setLeadership(false);
listeners.clear();
break;
+ }
+
default:
+ {
listeners.clear();
setLeadership(false);
break;
+ }
}
}
}