当前位置: 首页>>代码示例>>Java>>正文


Java WatcherType.Any方法代码示例

本文整理汇总了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;
}
 
开发者ID:sereca,项目名称:SecureKeeper,代码行数:25,代码来源:RemoveWatchesCommand.java

示例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);
    }
}
 
开发者ID:apache,项目名称:curator,代码行数:18,代码来源:RemoveWatchesBuilderImpl.java

示例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();
}
 
开发者ID:apache,项目名称:curator,代码行数:12,代码来源:RemoveWatchesBuilderImpl.java


注:本文中的org.apache.zookeeper.Watcher.WatcherType.Any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。