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(); } }
public void Dispose() { if (state.CompareAndSet(STARTED, CLOSED) == STARTED) { service.Dispose(); listeners.clear(); } }
public virtual void Dispose(bool isDisposing) { if (!_isDisposed) { _executorService.Dispose(); _isDisposed = true; } }
public void tearDown() { executorService.Dispose(); }
public virtual void Dispose() { _executorService.Dispose(); }