Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 589F810DF2 for ; Thu, 6 Mar 2014 11:47:31 +0000 (UTC) Received: (qmail 39395 invoked by uid 500); 6 Mar 2014 11:47:30 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 39366 invoked by uid 500); 6 Mar 2014 11:47:28 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 39353 invoked by uid 99); 6 Mar 2014 11:47:28 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Mar 2014 11:47:28 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2C148938DC8; Thu, 6 Mar 2014 11:47:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: more doc Date: Thu, 6 Mar 2014 11:47:28 +0000 (UTC) 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 Authored: Thu Mar 6 06:47:23 2014 -0500 Committer: randgalt 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; + } } } }