For disconnecting the {@link #SERVICE_UP} feed.
<p/>
Should be called from {@link #disconnectSensors()}.

@see #connectServiceUpIsRunning()
195032
protected void disconnectServiceUpIsRunning() {
        if (serviceProcessIsRunning != null) serviceProcessIsRunning.stop();
        // set null so the SERVICE_UP enricher runs (possibly removing it), then remove so
        // everything is removed
        // TODO race because the is-running check may be mid-task
        setAttribute(SERVICE_PROCESS_IS_RUNNING, null);
        removeAttribute(SERVICE_PROCESS_IS_RUNNING);
    }
289806
@Override
    public void removeServiceListener(ServiceListener listener) {
        // Note: if unfiltered service listeners are implemented
        // This method needs to look for, and remove, the listener there
        // as well

        // Go through all of the filters, and for each filter
        // remove the listener from the filter's list.
        for(Entry<String, List<ServiceListener>> filteredList : filteredServiceListeners.entrySet()) {
            filteredList.getValue().remove(listener);
        }
    }
1258364
private void disconnect(ZMQ.Socket socket, String eventName){
        String   endpoint = getConnectedEndPoint(eventName);
        if (endpoint!=null) {
            EventList eventList = connectedMap.get(endpoint);
            if (eventList!=null) {
                socket.unsubscribe(eventName.getBytes());
                traceZmqSubscription(eventName, false);
                eventList.remove(eventName);
                if (eventList.size()==0) {
                    socket.disconnect(endpoint);
                    connectedMap.remove(endpoint);
                }
            }
        }
    }
1028528
public void disconnect() {
        Presence unavailablePresence = null;
        if (isAuthenticated()) {
            unavailablePresence = new Presence(Presence.Type.unavailable);
        }
        try {
            disconnect(unavailablePresence);
        }
        catch (NotConnectedException e) {
            LOGGER.log(Level.FINEST, "Connection is already disconnected", e);
        }
    }
1299380
protected void shutdown() throws InterruptedException {
        if (m_deadConnectionFuture != null) {
            m_deadConnectionFuture.cancel(false);
            try {m_deadConnectionFuture.get();} catch (Throwable t) {}
        }
        if (m_topologyCheckFuture != null) {
            m_topologyCheckFuture.cancel(false);
            try {m_topologyCheckFuture.get();} catch (Throwable t) {}
        }
        if (m_maxConnectionUpdater != null) {
            m_maxConnectionUpdater.cancel(false);
        }
        if (m_acceptor != null) {
            m_acceptor.shutdown();
        }
        if (m_adminAcceptor != null)
        {
            m_adminAcceptor.shutdown();
        }
        if (m_snapshotDaemon != null) {
            m_snapshotDaemon.shutdown();
        }

        if (m_migratePartitionLeaderExecutor != null) {
            m_migratePartitionLeaderExecutor.shutdown();
        }
        m_notifier.shutdown();
    }
662360
@Override
	protected void disconnect() {

		// Stop thread
		super.disconnect();

		// Stop multicast receiver
		if (multicastReceiver != null) {
			try {
				InetAddress address = InetAddress.getByName(udpAddress);
				multicastReceiver.leaveGroup(address);
			} catch (Exception ignored) {
			}
			try {
				multicastReceiver.close();
			} catch (Exception ignored) {
			}
			multicastReceiver = null;
			String msg = "Multicast discovery service stopped on udp://" + udpAddress + ':' + udpPort;
			if (netIf == null) {
				logger.info(msg + '.');
			} else {
				logger.info(msg + " (" + netIf.getDisplayName() + ").");
			}
		}
	}
490191
protected void connectServiceUpIsRunning() {
        serviceProcessIsRunning = FunctionFeed.builder()
                .entity(this)
                .period(Duration.FIVE_SECONDS)
                .poll(new FunctionPollConfig<Boolean, Boolean>(SERVICE_PROCESS_IS_RUNNING)
                        .onException(Functions.constant(Boolean.FALSE))
                        .callable(new Callable<Boolean>() {
                            public Boolean call() {
                                return getDriver().isRunning();
                            }
                        }))
                .build();
    }
1186012
@Override
    public void disconnect()
    {
        network.disconnect();
        for (final L listener : listeners)
        {
            network.removeListener(listener);
        }
        listeners.clear();
    }
1170643
protected void disconnect() {

		// Stop broadcaster
		if (locator != null) {
			locator.disconnect();
			locator = null;
		}

		// Stop gossiper's timer
		if (gossiperTimer != null) {
			gossiperTimer.cancel(false);
			gossiperTimer = null;
		}

		// Close socket reader
		if (reader != null) {
			reader.disconnect();
			reader = null;
		}

		// Close socket writer
		if (writer != null) {
			writer.disconnect();
			writer = null;
		}
	}
842112
private void removeServiceListeners(String id) {
        final ServiceListener[] listeners = serviceListeners.remove(id);
        if (listeners != null)
            for (ServiceListener listener : listeners)
                if (listener != null) {
                    lock.readLock().lock();
                    try {
                        if (bundleContext != null)
                            bundleContext.removeServiceListener(listener);
                    } finally {
                        lock.readLock().unlock();
                    }
                }
    }
620122
def disconnect(self, receiver):
        """"""
        try:
            self.receivers.remove(receiver)
        except ValueError:
            raise ValueError('Unknown receiver: %s' % receiver)
951521
protected void finishConnection() {
    this.connector.dispose();
    this.connector = null;
    for (ConnectionListener listener : this.connectionListeners) {
      listener.connectionEnded(this);
    }
    if (this.executors != null) {
      this.executors.destroy();
    }
  }
1178148
public void disconnectSocket() {
        synchronized (lock) {
            if (socketConnection != null) {
                socketConnection.setManageReconnection(false);
                socketConnection.disconnect();
            }
            lock.notifyAll();
        }
    }
431618
protected void disconnect() {
		connected.set(false);
		synchronized (publishers) {
			for (Publisher publisher : publishers.values()) {
				try {
					publisher.shutdown();
				} catch (Exception ingored) {
				}
			}
			publishers.clear();
		}
		synchronized (subscribers) {
			for (Subscriber subscriber : subscribers.values()) {
				try {
					subscriber.stopAsync();
				} catch (Exception ingored) {
				}
			}
			subscribers.clear();
		}
		if (topicAdmin != null) {
			try {
				topicAdmin.close();
			} catch (Exception ingored) {
			}
			topicAdmin = null;
		}
		if (subscriptionAdmin != null) {
			try {
				subscriptionAdmin.close();
			} catch (Exception ingored) {
			}
			subscriptionAdmin = null;
		}
	}
1167031
private void removeConnectionCallbacks() {
        connection.removeSyncStanzaListener(messageListener);
        if (messageCollector != null) {
            messageCollector.cancel();
            messageCollector = null;
        }
    }
224786
public void disconnectBegin() {
		if (this.startPoint != null) {
			this.startPoint.remove(this);
		}
		this.startPoint = new SGraphPoint(getGraph());
		this.startPoint.add(this);
	}
1218675
@Override
	public final Promise disconnect() {
		if (client != null) {
			client.close();
			client = null;
		}
		return super.disconnect();
	}