Disconnect all clients an clear the connections when the handler is destroyed by CDI.
480503
@Override
    public void destroy() {
        synchronized (channels) {
            isCurrentlyShutingDown = true;
            for (final SynchronizeFXTomcatChannel server : channels.values()) {
                server.shutdown();
            }
            servers.clear();
            channels.clear();
            isCurrentlyShutingDown = false;

        }
    }
39206
def disconnect(self, client):
        
        self.clients.remove(client)
        del self.connect_args[client]
        client.disconnect()
779615
def clearConnections( self, cls ):
        
        count = 0
        for connection in self.connections(cls):
            connection.remove()
            count += 1
        return count
322649
def disconnect(self):
        
        if self.r_session:
            self.session_logout()

        self.r_session = None
        self.clear()
1014008
void closeConnections()
    {
        final String methodName = "closeConnections";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName);
        }

        synchronized (_connections)
        {
            Collection<SibRaMessagingEngineConnection> cons = _connections.values();
            Iterator<SibRaMessagingEngineConnection> iter = cons.iterator();
            while (iter.hasNext())
            {
                SibRaMessagingEngineConnection connection = iter.next();
                connection.close();
            }
            _connections.clear();
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(TRACE, methodName);
        }
    }
414330
def connectionLost(self, reason):
        
        if self._disconnectCBs:
            for cb in self._disconnectCBs:
                cb(self, reason)
486278
void destroy() {
        this.connection.removeListener(streamCloseListener);
        inFlightMessages.clear();
        promisedMessages.clear();
        http2ConnectionManager.removeClientChannel(httpRoute, this);
    }
1014602
@Override
    public final void destroy()
    {
        synchronized (this.connectionMonitor)
        {
            if (this.connection != null)
            {
                this.connection.destroy();
                this.connection = null;
            }
        }
        reset();
    }
402609
public void handleLostConnection() {
        try {
            clientEngine.applySelector(ClientSelectors.any());
        } catch (Exception e) {
            LOGGER.warning("Could not clean up client B/W list filtering.", e);
        }
    }
1223927
public void destroy() {
        this.existingChannels.clear();
        this.existingChannels = null;
        try {
            this.vcFactory.destroy();
        } catch (Exception e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(this, tc, "Error disconnecting from vc factory; " + e);
            }
        }
        this.vcFactory = null;
    }
1336785
protected void disconnect() {
		if (client != null) {
			try {
				client.stop();
			} catch (Exception ignored) {
			}
		}
		synchronized (publishers) {
			for (TopicPublisher publisher : publishers.values()) {
				try {
					publisher.close();
				} catch (Exception ignored) {
				}
			}
			publishers.clear();
		}
		synchronized (subscribers) {
			for (TopicSubscriber subscriber : subscribers.values()) {
				try {
					subscriber.close();
				} catch (Exception ignored) {
				}
			}
			subscribers.clear();
		}
		if (session != null) {
			try {
				session.close();
			} catch (Exception ignored) {
			}
			session = null;
		}
		if (client != null) {
			try {
				client.close();
			} catch (Exception ignored) {
			}
			client = null;
		}
	}
1243770
def disconnect(self):
        """"""
        for signal, kwargs in self.connections:
            signal.disconnect(self, **kwargs)
539692
protected static void shutdownClient() {
		if (ddbClient != null) {
			ddbClient.shutdown();
			ddbClient = null;
			ddb.shutdown();
			ddb = null;
		}
	}
614659
private function clearConnectionPool()
    {
        $deleted = $this->connectionPool->removeInvalid();

        foreach ($deleted as $deletedid)
        {
            $this->emit('disconnect', [ $deletedid ]);
        }
    }
316846
def purge(self, name=None):
        
        self.disconnect(name)

        if name in self._connections:
            del self._connections[name]
467190
def disconnect():
    """"""
    # Reset the list of cached remote functions and actors so that if more
    # remote functions or actors are defined and then connect is called again,
    # the remote functions will be exported. This is mostly relevant for the
    # tests.
    worker = global_worker
    if worker.connected:
        # Shutdown all of the threads that we've started. TODO(rkn): This
        # should be handled cleanly in the worker object's destructor and not
        # in this disconnect method.
        worker.threads_stopped.set()
        if hasattr(worker, "import_thread"):
            worker.import_thread.join_import_thread()
        if hasattr(worker, "profiler") and hasattr(worker.profiler, "t"):
            worker.profiler.join_flush_thread()
        if hasattr(worker, "listener_thread"):
            worker.listener_thread.join()
        if hasattr(worker, "printer_thread"):
            worker.printer_thread.join()
        if hasattr(worker, "logger_thread"):
            worker.logger_thread.join()
        worker.threads_stopped.clear()
        worker._session_index += 1

    worker.node = None  # Disconnect the worker from the node.
    worker.cached_functions_to_run = []
    worker.function_actor_manager.reset_cache()
    worker.serialization_context_map.clear()

    if hasattr(worker, "raylet_client"):
        del worker.raylet_client
    if hasattr(worker, "plasma_client"):
        worker.plasma_client.disconnect()
402038
def disconnect(self):
        
        logger.info("Disconnecting from Zookeeper.")
        self.client.stop()
        self.client.close()