curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [07/10] git commit: wip
Date Sat, 22 Mar 2014 13:35:22 GMT
wip


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

Branch: refs/heads/websockets
Commit: a08f3c55db4c91e4baf809c19f5c9da23e648360
Parents: f68a785
Author: randgalt <randgalt@apache.org>
Authored: Sat Jan 11 13:18:36 2014 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Sat Jan 11 13:18:36 2014 -0500

----------------------------------------------------------------------
 .../curator/x/websockets/api/zookeeper/Create.java | 17 +++++++++++++++--
 .../x/websockets/details/CuratorEndpoint.java      |  1 +
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/a08f3c55/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/api/zookeeper/Create.java
----------------------------------------------------------------------
diff --git a/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/api/zookeeper/Create.java
b/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/api/zookeeper/Create.java
index 24cb076..eba903e 100644
--- a/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/api/zookeeper/Create.java
+++ b/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/api/zookeeper/Create.java
@@ -19,9 +19,13 @@
 
 package org.apache.curator.x.websockets.api.zookeeper;
 
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.api.BackgroundCallback;
+import org.apache.curator.framework.api.BackgroundPathAndBytesable;
 import org.apache.curator.framework.api.Compressible;
 import org.apache.curator.framework.api.CreateBuilder;
 import org.apache.curator.framework.api.CreateModable;
+import org.apache.curator.framework.api.CuratorEvent;
 import org.apache.curator.framework.api.PathAndBytesable;
 import org.apache.curator.x.websockets.api.ApiCommand;
 import org.apache.curator.x.websockets.api.JsonUtils;
@@ -33,6 +37,7 @@ import org.codehaus.jackson.map.ObjectWriter;
 
 public class Create implements ApiCommand
 {
+    @SuppressWarnings("unchecked")
     @Override
     public void process(String id, JsonNode input, CuratorWebsocketsSession session, ObjectReader
reader, ObjectWriter writer) throws Exception
     {
@@ -67,14 +72,22 @@ public class Create implements ApiCommand
                 builder = ((CreateModable)builder).withMode(createMode);
             }
 
+            BackgroundCallback callback = new BackgroundCallback()
+            {
+                @Override
+                public void processResult(CuratorFramework client, CuratorEvent event) throws
Exception
+                {
+                    System.out.println();
+                }
+            };
             if ( payload != null )
             {
                 String payloadStr = writer.writeValueAsString(payload);
-                result = ((PathAndBytesable)builder).forPath(path, payloadStr.getBytes());
+                result = ((BackgroundPathAndBytesable<String>)builder).inBackground(callback).forPath(path,
payloadStr.getBytes());
             }
             else
             {
-                result = ((PathAndBytesable)builder).forPath(path);
+                result = ((BackgroundPathAndBytesable<String>)builder).inBackground(callback).forPath(path);
             }
         }
         catch ( ClassCastException e )

http://git-wip-us.apache.org/repos/asf/curator/blob/a08f3c55/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/details/CuratorEndpoint.java
----------------------------------------------------------------------
diff --git a/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/details/CuratorEndpoint.java
b/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/details/CuratorEndpoint.java
index 6f664de..adf6dfb 100644
--- a/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/details/CuratorEndpoint.java
+++ b/curator-x-websockets/src/main/java/org/apache/curator/x/websockets/details/CuratorEndpoint.java
@@ -81,6 +81,7 @@ public class CuratorEndpoint extends Endpoint
         catch ( Exception e )
         {
             // TODO
+            e.printStackTrace();
         }
 
         MessageHandler handler = new MessageHandler.Whole<String>()


Mime
View raw message