Пример #1
0
        public void close()
        {
            log.Debug("Closing");
            if (state.CompareAndSet(CuratorFrameworkState.STARTED, CuratorFrameworkState.STOPPED))
            {
                listeners.forEach(listener =>
                {
                    ICuratorEvent @event = new CuratorEventImpl(this, CuratorEventType.CLOSING, 0, null, null, null, null, null, null, null, null);
                    try
                    {
                        listener.eventReceived(this, @event);
                    }
                    catch (Exception e)
                    {
                        ThreadUtils.checkInterrupted(e);
                        log.Error("Exception while sending Closing event", e);
                    }
                    return(null);
                });

                if (executorService != null)
                {
                    executorService.Dispose();
                }

                listeners.clear();
                unhandledErrorListeners.clear();
                connectionStateManager.Dispose();
                client.Dispose();
                namespaceWatcherMap.Dispose();
            }
        }
Пример #2
0
 public void Dispose()
 {
     if (state.CompareAndSet(STARTED, CLOSED) == STARTED)
     {
         service.Dispose();
         listeners.clear();
     }
 }
Пример #3
0
 public virtual void Dispose(bool isDisposing)
 {
     if (!_isDisposed)
     {
         _executorService.Dispose();
         _isDisposed = true;
     }
 }
Пример #4
0
 public void tearDown()
 {
     executorService.Dispose();
 }
Пример #5
0
 public virtual void Dispose()
 {
     _executorService.Dispose();
 }