Class AddWatchBuilderImpl
- java.lang.Object
-
- org.apache.curator.framework.imps.AddWatchBuilderImpl
-
- All Implemented Interfaces:
AddWatchBuilder,AddWatchBuilder2,Backgroundable<WatchableBase<Pathable<java.lang.Void>>>,Pathable<java.lang.Void>,WatchableBase<Pathable<java.lang.Void>>
public class AddWatchBuilderImpl extends java.lang.Object implements AddWatchBuilder, Pathable<java.lang.Void>
-
-
Constructor Summary
Constructors Constructor Description AddWatchBuilderImpl(CuratorFrameworkImpl client, Watching watching, Backgrounding backgrounding, org.apache.zookeeper.AddWatchMode mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.VoidforPath(java.lang.String path)Commit the currently building operation using the given pathWatchableBase<Pathable<java.lang.Void>>inBackground()Perform the action in the backgroundWatchableBase<Pathable<java.lang.Void>>inBackground(java.lang.Object context)Perform the action in the backgroundWatchableBase<Pathable<java.lang.Void>>inBackground(BackgroundCallback callback)Perform the action in the backgroundWatchableBase<Pathable<java.lang.Void>>inBackground(BackgroundCallback callback, java.lang.Object context)Perform the action in the backgroundWatchableBase<Pathable<java.lang.Void>>inBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)Perform the action in the backgroundWatchableBase<Pathable<java.lang.Void>>inBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)Perform the action in the backgroundvoidperformBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<java.lang.String> data)Pathable<java.lang.Void>usingWatcher(CuratorWatcher watcher)Set a watcher for the operationPathable<java.lang.Void>usingWatcher(org.apache.zookeeper.Watcher watcher)Set a watcher for the operationAddWatchBuilder2withMode(org.apache.zookeeper.AddWatchMode mode)The mode to use.
-
-
-
Constructor Detail
-
AddWatchBuilderImpl
public AddWatchBuilderImpl(CuratorFrameworkImpl client, Watching watching, Backgrounding backgrounding, org.apache.zookeeper.AddWatchMode mode)
-
-
Method Detail
-
inBackground
public WatchableBase<Pathable<java.lang.Void>> inBackground()
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<WatchableBase<Pathable<java.lang.Void>>>- Returns:
- this
-
withMode
public AddWatchBuilder2 withMode(org.apache.zookeeper.AddWatchMode mode)
Description copied from interface:AddWatchBuilderThe mode to use. By default,AddWatchMode.PERSISTENT_RECURSIVEis used- Specified by:
withModein interfaceAddWatchBuilder- Parameters:
mode- mode to use- Returns:
- this
-
usingWatcher
public Pathable<java.lang.Void> usingWatcher(org.apache.zookeeper.Watcher watcher)
Description copied from interface:WatchableBaseSet a watcher for the operation- Specified by:
usingWatcherin interfaceWatchableBase<Pathable<java.lang.Void>>- Parameters:
watcher- the watcher- Returns:
- this
-
usingWatcher
public Pathable<java.lang.Void> usingWatcher(CuratorWatcher watcher)
Description copied from interface:WatchableBaseSet a watcher for the operation- Specified by:
usingWatcherin interfaceWatchableBase<Pathable<java.lang.Void>>- Parameters:
watcher- the watcher- Returns:
- this
-
inBackground
public WatchableBase<Pathable<java.lang.Void>> inBackground(java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<WatchableBase<Pathable<java.lang.Void>>>- Parameters:
context- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public WatchableBase<Pathable<java.lang.Void>> inBackground(BackgroundCallback callback)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<WatchableBase<Pathable<java.lang.Void>>>- Parameters:
callback- a functor that will get called when the operation has completed- Returns:
- this
-
inBackground
public WatchableBase<Pathable<java.lang.Void>> inBackground(BackgroundCallback callback, java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<WatchableBase<Pathable<java.lang.Void>>>- Parameters:
callback- a functor that will get called when the operation has completedcontext- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public WatchableBase<Pathable<java.lang.Void>> inBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<WatchableBase<Pathable<java.lang.Void>>>- Parameters:
callback- a functor that will get called when the operation has completedexecutor- executor to use for the background call- Returns:
- this
-
inBackground
public WatchableBase<Pathable<java.lang.Void>> inBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<WatchableBase<Pathable<java.lang.Void>>>- Parameters:
callback- a functor that will get called when the operation has completedcontext- context object - will be available from the event sent to the listenerexecutor- executor to use for the background call- Returns:
- this
-
forPath
public java.lang.Void forPath(java.lang.String path) throws java.lang.ExceptionDescription copied from interface:PathableCommit the currently building operation using the given path
-
performBackgroundOperation
public void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<java.lang.String> data) throws java.lang.Exception- Throws:
java.lang.Exception
-
-