Contains ZooKeeper session state changed event data
Наследование: ZooKeeperEventArgs
Пример #1
0
        /// <summary>
        /// Called when the ZooKeeper connection state has changed.
        /// </summary>
        /// <param name="args">The <see cref="Kafka.Client.ZooKeeperIntegration.Events.ZooKeeperStateChangedEventArgs"/> instance containing the event data.</param>
        /// <remarks>
        /// Do nothing, since zkclient will do reconnect for us.
        /// </remarks>
        public void HandleStateChanged(ZooKeeperStateChangedEventArgs args)
        {
            Guard.Assert<ArgumentNullException>(() => args != null);
            Guard.Assert<ArgumentException>(() => args.State != KeeperState.Unknown);

            this.EnsuresNotDisposed();
            Logger.Debug("Handle state change: do nothing, since zkclient will do reconnect for us.");
        }
Пример #2
0
 public void HandleStateChanged(ZooKeeperStateChangedEventArgs args)
 {
     Logger.Debug(args + " reach test event handler");
     this.events.Add(args);
 }
        /// <summary>
        /// Invokes subscribed handlers for ZooKeeeper state changes event
        /// </summary>
        /// <param name="e">
        /// The event data
        /// </param>
        private void OnStateChanged(ZooKeeperStateChangedEventArgs e)
        {
            try
            {
                var handlers = this.stateChangedHandlers;
                if (handlers == null)
                {
                    return;
                }

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

                handlers(e);
            }
            catch (Exception exc)
            {
                Logger.ErrorFormat("Failed to handle state changed event.  {0}", exc.FormatException());
            }
        }
Пример #4
0
 /// <summary>
 /// Called when the ZooKeeper connection state has changed.
 /// </summary>
 /// <param name="args">The <see cref="Kafka.Client.ZooKeeperIntegration.Events.ZooKeeperStateChangedEventArgs"/> instance containing the event data.</param>
 /// <remarks>
 /// Do nothing, since zkclient will do reconnect for us.
 /// </remarks>
 public void HandleStateChanged(ZooKeeperStateChangedEventArgs args)
 {
     Guard.Assert<ArgumentNullException>(() => args != null);
     Guard.Assert<ArgumentException>(() => args.State != KeeperState.Unknown);
 }