curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsi...@apache.org
Subject [04/41] curator git commit: refactored
Date Mon, 17 Aug 2015 17:02:12 GMT
refactored


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/85697633
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/85697633
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/85697633

Branch: refs/heads/CURATOR-3.0
Commit: 85697633a94508637ee22f1df64a06ddb72d0660
Parents: 31130fd
Author: randgalt <randgalt@apache.org>
Authored: Tue May 19 14:59:41 2015 -0700
Committer: randgalt <randgalt@apache.org>
Committed: Tue May 19 14:59:41 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/curator/utils/ZKPaths.java   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/85697633/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java
----------------------------------------------------------------------
diff --git a/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java b/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java
index f91f03d..242e4b7 100644
--- a/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java
+++ b/curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java
@@ -38,10 +38,18 @@ public class ZKPaths
      */
     public static final String PATH_SEPARATOR = "/";
 
-    public static class CreatModeHolder
+    /**
+     * @return {@link CreateMode#CONTAINER} if the ZK JAR supports it. Otherwise {@link CreateMode#PERSISTENT}
+     */
+    public static CreateMode getContainerCreateMode()
+    {
+        return CreateModeHolder.containerCreateMode;
+    }
+
+    private static class CreateModeHolder
     {
         private static final Logger log = LoggerFactory.getLogger(ZKPaths.class);
-        public static final CreateMode containerCreateMode;
+        private static final CreateMode containerCreateMode;
 
         static
         {
@@ -442,6 +450,6 @@ public class ZKPaths
 
     private static CreateMode getCreateMode(boolean asContainers)
     {
-        return asContainers ? CreatModeHolder.containerCreateMode : CreateMode.PERSISTENT;
+        return asContainers ? getContainerCreateMode() : CreateMode.PERSISTENT;
     }
 }


Mime
View raw message