@Override public void close() throws InterruptedException { // NOTE: the curator instance is NOT closed here CuratorListener localListener = listener.getAndSet(null); if ( localListener != null ) { curator.getCuratorListenable().removeListener(localListener); } }
@Override public void close() { if (clusterId != null) { client.getConnectionStateListenable().removeListener(connectionStateListener); } client.close(); }
@Override public void stateChanged(CuratorFramework client, ConnectionState newState) { if (newState == ConnectionState.CONNECTED) { initialConnection.countDown(); client.getConnectionStateListenable().removeListener(this); } }
@Override public void close() throws IOException { State currentState = state.getAndSet(State.CLOSED); if (currentState == State.CLOSED || currentState == State.LATENT) return; client.getConnectionStateListenable().removeListener(connectionStateListener); String localNodePath = nodePath.getAndSet(null); if (localNodePath == null) return; try { client.delete().guaranteed().forPath(localNodePath); } catch (KeeperException.NoNodeException ignore) { } catch (Exception e) { LOG.error("Deleting node: " + localNodePath, e); throw new IOException(e); } }
public void close() { if (zkCoord == null) { return; } zkCoord.getCurator().getConnectionStateListenable() .removeListener(stateListener); try { zkCoord.close(); } catch (Exception e) { ZKClusterCoordinator.logger.error("Error occurred on ZK close, ignored", e); } zkCoord = null; }
@Override public void close() { if ( state.compareAndSet(State.STARTED, State.CLOSED) ) { client.removeWatchers(); client.getConnectionStateListenable().removeListener(connectionStateListener); } }
private LoadBalancer() { try { start(); }catch(Exception ex){ LOG.error("Exception while creating a zookeeper clients and cache",ex); if ((curaFramework != null) && (connectionStateListener != null)){ curaFramework.getConnectionStateListenable() .removeListener(connectionStateListener); } if ((curaFramework != null) && (unhandledErrorListener != null)){ curaFramework.getUnhandledErrorListenable() .removeListener(unhandledErrorListener); } for (Closeable closeable : closeAbles) { CloseableUtils.closeQuietly(closeable); } } }
@Override public void stateChanged(CuratorFramework client, ConnectionState newState) { if(newState == ConnectionState.CONNECTED) { ZKClusterCoordinator.this.initialConnection.countDown(); client.getConnectionStateListenable().removeListener(this); } }
@Override public void close() { if (clusterId != null) { client.getConnectionStateListenable().removeListener(connectionStateListener); } client.close(); }
@Override public void stateChanged(CuratorFramework client, ConnectionState newState) { if(newState == ConnectionState.CONNECTED) { ZKClusterClient.this.initialConnection.countDown(); client.getConnectionStateListenable().removeListener(this); } } }
/** * Close/end the cache * * @throws java.io.IOException errors */ @Override public void close() throws IOException { //Preconditions.checkState(!executorService.isShutdown(), "has not been started"); client.getConnectionStateListenable().removeListener(connectionStateListener); executorService.shutdownNow(); }
@Override public void remove() { treeCache.getListenable().removeListener(pathChildrenCacheListener); } };
/** * Shutdown this selector and remove yourself from the leadership group */ public synchronized void close() { Preconditions.checkState(state.compareAndSet(State.STARTED, State.CLOSED), "Already closed or has not been started"); client.getConnectionStateListenable().removeListener(listener); executorService.close(); ourTask.set(null); }
public void close() { cache.getListenable().removeListener(this); cache.close(); entries.clear(); }
@Override public void close() throws IOException { client.getConnectionStateListenable().removeListener(connectionStateListener); state.set(State.CLOSED); listeners.clear(); }
@Override public Void apply(ServiceCacheListener listener) { discovery.getClient().getConnectionStateListenable().removeListener(listener); return null; } }
@Override public Void apply(ServiceCacheListener<T> listener) { discovery.getClient().getConnectionStateListenable().removeListener(listener); return null; } }
@Override protected void doStop() { if (node != null && curatorClient.getState() != CuratorFrameworkState.STOPPED) { try { node.close(); } catch (IOException e) { } finally { node = null; } } curatorClient.getConnectionStateListenable().removeListener(connectionListener); }
@Override public void removeListener(ServiceCacheListener listener) { listenerContainer.removeListener(listener); discovery.getClient().getConnectionStateListenable().removeListener(listener); }
@Override public void removeListener(ServiceCacheListener listener) { listenerContainer.removeListener(listener); discovery.getClient().getConnectionStateListenable().removeListener(listener); }