Contains znode data changed event data
Наследование: ZooKeeperEventArgs
        /// <summary>
        /// Invokes subscribed handlers for ZooKeeeper data deletes event
        /// </summary>
        /// <param name="e">
        /// The event data.
        /// </param>
        public void OnDataDeleted(ZooKeeperDataChangedEventArgs e)
        {
            var handlers = this.dataDeleted;

            if (handlers == null)
            {
                return;
            }

            foreach (var handler in handlers.GetInvocationList())
            {
                Logger.Debug(e + " sent to " + handler.Target);
            }

            handlers(e);
        }
        /// <summary>
        /// Invokes subscribed handlers for ZooKeeeper data changes event
        /// </summary>
        /// <param name="e">
        /// The event data.
        /// </param>
        private void OnDataChanged(ZooKeeperDataChangedEventArgs e)
        {
            DataChangedEventItem handlers;
            this.dataChangedHandlers.TryGetValue(e.Path, out handlers);
            if (handlers == null || handlers.TotalCount == 0)
            {
                return;
            }

            try
            {
                this.Exists(e.Path, true);
                var data = this.ReadData<string>(e.Path, null, true);
                e.Data = data;
                handlers.OnDataChanged(e);
            }
            catch (KeeperException ex)
            {
                if (ex.ErrorCode == KeeperException.Code.NONODE)
                    handlers.OnDataDeleted(e);
                else
                    throw;
            }
        }
Пример #3
0
        /// <summary>
        /// Invokes subscribed handlers for ZooKeeeper data deletes event
        /// </summary>
        /// <param name="e">
        /// The event data.
        /// </param>
        public void OnDataDeleted(ZooKeeperDataChangedEventArgs e)
        {
            var handlers = this.dataDeleted;
            if (handlers == null)
            {
                return;
            }

            foreach (var handler in handlers.GetInvocationList())
            {
                this.logger.Debug(e + " sent to " + handler.Target);
            }

            handlers(e);
        }
Пример #4
0
 public void HandleDataDelete(ZooKeeperDataChangedEventArgs args)
 {
     Logger.Debug(args + " reach test event handler");
     this.events.Add(args);
 }