Permalink
Browse files

Issue 74 - there were some missing combinations in the backgrounding API

  • Loading branch information...
1 parent 0ca5859 commit e378578c3d713d35928826f3ce95ae1a71665681 @Randgalt Randgalt committed May 24, 2012
@@ -48,8 +48,27 @@
* Perform the action in the background
*
* @param callback a functor that will get called when the operation has completed
+ * @param context context object - will be available from the event sent to the listener
+ * @return this
+ */
+ public T inBackground(BackgroundCallback callback, Object context);
+
+ /**
+ * Perform the action in the background
+ *
+ * @param callback a functor that will get called when the operation has completed
* @param executor executor to use for the background call
* @return this
*/
public T inBackground(BackgroundCallback callback, Executor executor);
+
+ /**
+ * Perform the action in the background
+ *
+ * @param callback a functor that will get called when the operation has completed
+ * @param context context object - will be available from the event sent to the listener
+ * @param executor executor to use for the background call
+ * @return this
+ */
+ public T inBackground(BackgroundCallback callback, Object context, Executor executor);
}
@@ -49,6 +49,18 @@
this.callback = null;
}
+ Backgrounding(BackgroundCallback callback, Object context)
+ {
+ this.inBackground = true;
+ this.context = context;
+ this.callback = callback;
+ }
+
+ Backgrounding(CuratorFrameworkImpl client, BackgroundCallback callback, Object context, Executor executor)
+ {
+ this(wrapCallback(client, callback, executor), context);
+ }
+
Backgrounding(CuratorFrameworkImpl client, BackgroundCallback callback, Executor executor)
{
this(wrapCallback(client, callback, executor));
@@ -126,6 +126,18 @@ public CreateBackgroundModeACLable compressed()
}
@Override
+ public PathAndBytesable<String> inBackground(BackgroundCallback callback, Object context)
+ {
+ return CreateBuilderImpl.this.inBackground(callback, context);
+ }
+
+ @Override
+ public PathAndBytesable<String> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ return CreateBuilderImpl.this.inBackground(callback, context, executor);
+ }
+
+ @Override
public PathAndBytesable<String> inBackground()
{
return CreateBuilderImpl.this.inBackground();
@@ -188,6 +200,18 @@ public String forPath(String path) throws Exception
}
@Override
+ public PathAndBytesable<String> inBackground(BackgroundCallback callback, Object context)
+ {
+ return CreateBuilderImpl.this.inBackground(callback, context);
+ }
+
+ @Override
+ public PathAndBytesable<String> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ return CreateBuilderImpl.this.inBackground(callback, context, executor);
+ }
+
+ @Override
public PathAndBytesable<String> inBackground(Object context)
{
return CreateBuilderImpl.this.inBackground(context);
@@ -269,6 +293,20 @@ public String forPath(String path) throws Exception
}
@Override
+ public PathAndBytesable<String> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public PathAndBytesable<String> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public PathAndBytesable<String> inBackground(BackgroundCallback callback)
{
backgrounding = new Backgrounding(callback);
@@ -86,6 +86,20 @@ public DeleteBuilderBase guaranteed()
}
@Override
+ public Pathable<Void> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public Pathable<Void> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public Pathable<Void> inBackground(BackgroundCallback callback)
{
backgrounding = new Backgrounding(callback);
@@ -67,6 +67,20 @@
}
@Override
+ public Pathable<Stat> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public Pathable<Stat> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public Pathable<Stat> inBackground(BackgroundCallback callback)
{
backgrounding = new Backgrounding(callback);
@@ -45,6 +45,20 @@
}
@Override
+ public Pathable<List<ACL>> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public Pathable<List<ACL>> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public Pathable<List<ACL>> inBackground()
{
backgrounding = new Backgrounding(true);
@@ -85,6 +85,20 @@
}
@Override
+ public Pathable<List<String>> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public Pathable<List<String>> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public Pathable<List<String>> inBackground(BackgroundCallback callback)
{
backgrounding = new Backgrounding(callback);
@@ -68,6 +68,18 @@ public GetDataWatchBackgroundStatable decompressed()
}
@Override
+ public Pathable<byte[]> inBackground(BackgroundCallback callback, Object context)
+ {
+ return GetDataBuilderImpl.this.inBackground(callback, context);
+ }
+
+ @Override
+ public Pathable<byte[]> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ return GetDataBuilderImpl.this.inBackground(callback, context, executor);
+ }
+
+ @Override
public Pathable<byte[]> inBackground(Object context)
{
return GetDataBuilderImpl.this.inBackground(context);
@@ -153,6 +165,20 @@ public GetDataWatchBackgroundStatable decompressed()
}
@Override
+ public Pathable<byte[]> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public Pathable<byte[]> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public Pathable<byte[]> inBackground(BackgroundCallback callback)
{
backgrounding = new Backgrounding(callback);
@@ -83,6 +83,20 @@
}
@Override
+ public Pathable<Stat> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public Pathable<Stat> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public Pathable<Stat> inBackground(BackgroundCallback callback, Executor executor)
{
backgrounding = new Backgrounding(client, callback, executor);
@@ -90,6 +90,18 @@ public SetDataBackgroundVersionable compressed()
}
@Override
+ public PathAndBytesable<Stat> inBackground(BackgroundCallback callback, Object context)
+ {
+ return SetDataBuilderImpl.this.inBackground(callback, context);
+ }
+
+ @Override
+ public PathAndBytesable<Stat> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ return SetDataBuilderImpl.this.inBackground(callback, context, executor);
+ }
+
+ @Override
public PathAndBytesable<Stat> inBackground(Object context)
{
return SetDataBuilderImpl.this.inBackground(context);
@@ -135,6 +147,20 @@ public Stat forPath(String path) throws Exception
}
@Override
+ public PathAndBytesable<Stat> inBackground(BackgroundCallback callback, Object context)
+ {
+ backgrounding = new Backgrounding(callback, context);
+ return this;
+ }
+
+ @Override
+ public PathAndBytesable<Stat> inBackground(BackgroundCallback callback, Object context, Executor executor)
+ {
+ backgrounding = new Backgrounding(client, callback, context, executor);
+ return this;
+ }
+
+ @Override
public PathAndBytesable<Stat> inBackground(BackgroundCallback callback)
{
backgrounding = new Backgrounding(callback);

0 comments on commit e378578

Please sign in to comment.