本文整理汇总了Java中org.apache.zookeeper.Watcher.WatcherType.Any方法的典型用法代码示例。如果您正苦于以下问题:Java WatcherType.Any方法的具体用法?Java WatcherType.Any怎么用?Java WatcherType.Any使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.zookeeper.Watcher.WatcherType
的用法示例。
在下文中一共展示了WatcherType.Any方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exec
import org.apache.zookeeper.Watcher.WatcherType; //导入方法依赖的package包/类
@Override
public boolean exec() throws KeeperException, InterruptedException {
String path = args[1];
WatcherType wtype = WatcherType.Any;
// if no matching option -c or -d or -a is specified, we remove
// the watches of the given node by choosing WatcherType.Any
if (cl.hasOption("c")) {
wtype = WatcherType.Children;
} else if (cl.hasOption("d")) {
wtype = WatcherType.Data;
} else if (cl.hasOption("a")) {
wtype = WatcherType.Any;
}
// whether to remove the watches locally
boolean local = cl.hasOption("l");
try {
zk.removeAllWatches(path, wtype, local);
} catch (KeeperException.NoWatcherException ex) {
err.println(ex.getMessage());
return false;
}
return true;
}
示例2: internalRemoval
import org.apache.zookeeper.Watcher.WatcherType; //导入方法依赖的package包/类
void internalRemoval(Watcher watcher, String path) throws Exception
{
this.watcher = watcher;
watcherType = WatcherType.Any;
quietly = true;
guaranteed = true;
if ( Boolean.getBoolean(DebugUtils.PROPERTY_REMOVE_WATCHERS_IN_FOREGROUND) )
{
this.backgrounding = new Backgrounding();
pathInForeground(path);
}
else
{
this.backgrounding = new Backgrounding(true);
pathInBackground(path);
}
}
示例3: RemoveWatchesBuilderImpl
import org.apache.zookeeper.Watcher.WatcherType; //导入方法依赖的package包/类
public RemoveWatchesBuilderImpl(CuratorFrameworkImpl client)
{
this.client = client;
this.watcher = null;
this.curatorWatcher = null;
this.watcherType = WatcherType.Any;
this.guaranteed = false;
this.local = false;
this.quietly = false;
this.backgrounding = new Backgrounding();
}