Merge branch 'master' into CURATOR-3.0
Conflicts:
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/4e4072b0
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/4e4072b0
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/4e4072b0
Branch: refs/heads/CURATOR-3.0
Commit: 4e4072b08be2da21a656bd6a328ffbfb2efa6906
Parents: 1f86681 da9f5d0
Author: randgalt <[email protected]>
Authored: Tue Feb 2 16:48:37 2016 -0500
Committer: randgalt <[email protected]>
Committed: Tue Feb 2 16:48:37 2016 -0500
----------------------------------------------------------------------
.../framework/recipes/nodes/PersistentNode.java | 104 ++++++++++++-------
.../recipes/nodes/TestPersistentNode.java | 46 ++++++++
2 files changed, 114 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/4e4072b0/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
----------------------------------------------------------------------
diff --cc
curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
index 93c88f7,c472fdd..d879d69
---
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
+++
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentNode.java
@@@ -173,44 -157,11 +173,11 @@@ public class PersistentNode implements
backgroundCallback = new BackgroundCallback()
{
@Override
- public void processResult(CuratorFramework client, CuratorEvent
event) throws Exception
+ public void processResult(CuratorFramework dummy, CuratorEvent
event) throws Exception
{
- if ( !isActive() )
- if ( state.get() == State.STARTED )
++ if ( isActive() )
{
- return;
- }
-
- String path = null;
- boolean nodeExists = false;
- if ( event.getResultCode() ==
KeeperException.Code.NODEEXISTS.intValue() )
- {
- path = event.getPath();
- nodeExists = true;
- }
- else if ( event.getResultCode() ==
KeeperException.Code.OK.intValue() )
- {
- path = event.getName();
- }
- else if ( event.getResultCode() ==
KeeperException.Code.NOAUTH.intValue() )
- {
- log.warn("Client does not have authorization to write
node at path {}", event.getPath());
- authFailure.set(true);
- return;
- }
- if ( path != null )
- {
- authFailure.set(false);
- nodePath.set(path);
- watchNode();
-
- if ( nodeExists )
- {
-
client.setData().inBackground(setDataCallback).forPath(getActualPath(),
getData());
- }
- else
- {
- initialisationComplete();
- }
+ processBackgroundCallback(event);
}
else
{
http://git-wip-us.apache.org/repos/asf/curator/blob/4e4072b0/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentNode.java
----------------------------------------------------------------------