コード例 #1
0
 public static bool IsExistWatche(string path)
 {
     if (_client == null)
     {
         return(false);
     }
     lock (SyncRoot)
     {
         return(_client.IsExistWatche(path));
     }
 }
コード例 #2
0
 /// <summary>
 /// 启动监视
 /// </summary>
 public void Monitor()
 {
     try
     {
         bool flag = _zooKeeperClient.IsExistWatche(_monitorPath);
         if (flag)
         {
             return;
         }
         Stat   stat = new Stat();
         string data = _zooKeeperClient.GetData(_monitorPath, this, stat);
         NodeWatchers.Add(this);
         LogManager.GetLogger().Info(string.Format("DisconfClient.NodeWatcher.Monitor, MonitorPath:{0}", _monitorPath));
     }
     catch (Exception ex)
     {
         LogManager.GetLogger().Error(string.Format("DisconfClient.NodeWatcher.Monitor, MonitorPath:{0}, Exception:{1}", _monitorPath, ex));
     }
 }