Get a instance of a MUC Light manager for the given connection.

@param connection
@return a MUCLight manager.
512018
public static synchronized MultiUserChatLightManager getInstanceFor(XMPPConnection connection) {
        MultiUserChatLightManager multiUserChatLightManager = INSTANCES.get(connection);
        if (multiUserChatLightManager == null) {
            multiUserChatLightManager = new MultiUserChatLightManager(connection);
            INSTANCES.put(connection, multiUserChatLightManager);
        }
        return multiUserChatLightManager;
    }
99204
public DevSource get_source(final Connection connection) throws DevFailed {
		if (is_taco(connection)) {
	    	if (connection.taco_device == null) {
			connection.taco_device = new TacoTangoDevice(connection.devname,
				connection.url.host);
	    	}
	    	return connection.taco_device.get_source();
		} else {
	    	return connection.dev_src;
		}
    }
774719
public static synchronized void returnConnection(String poolName, Object mcp, Object cl, Object connection)
   {
      log.tracef("%s", new TraceEvent(poolName,
                                      Integer.toHexString(System.identityHashCode(mcp)),
                                      TraceEvent.RETURN_CONNECTION,
                                      Integer.toHexString(System.identityHashCode(cl)),
                                      Integer.toHexString(System.identityHashCode(connection))));
   }
1253104
public function getEntityManager(string $connection = 'default'): EntityManager
    {
        if (!isset($this->entityManager[$connection])) {
            $this->entityManager[$connection] = new EntityManager($this->getConnection($connection));
        }

        return $this->entityManager[$connection];
    }
417902
public synchronized void build_connection(final Connection connection) throws DevFailed {
		if (!connection.deviceCreated()) {
            if (connection.devname != null) {
				final long t = System.currentTimeMillis();
				final long delay = t - connection.getPrev_failed_t0();
				boolean try_reconnection = true;

				// Check if connection on database or on a device
				if (connection.isDevice_is_dbase()) {
		    		connect_to_dbase(connection);
				}
                else {
		    		try {
                        // url.trace();
                        // Check if Tango or taco device
                        if (connection.url.protocol == TANGO) {
                            if (connection instanceof DeviceProxy) {
                                //  Set admin device to null to force reconnection.
                                ((DeviceProxy) connection).setAdm_dev(null);
                            }

                            // Do not reconnect if to soon
                            if (connection.isPrev_failed()
                                && delay < ApiUtil.getReconnectionDelay()) {
                                try_reconnection = false;
                                throw connection.getPrev_failed();
                            }
                            //if (!connection.devname.startsWith("tango"))
                            //	System.out.println(" Try reconnection on " +
                            //			connection.devname +":	" + delay + " ms");
                            connection.setPrev_failed_t0(t);

                            // Check if connection with database or without
                            if (connection.url.use_db) {
                                dev_import(connection);
                            } else {
                                dev_import_without_dbase(connection);
                            }
                            connection.setPrev_failed(null);
                        }
                        else
                        if (connection.url.protocol == TACO) {
                            if (connection.taco_device == null) {
                                connection.taco_device =
                                    new TacoTangoDevice(connection.devname, connection.url.host);
                            }
                        }
		    		}
                    catch (final DevFailed e) {
						if (try_reconnection) {
			    			connection.setPrev_failed_t0(t);
			    			connection.setPrev_failed(e);
						}
						connection.ior = null;
						Except.throw_communication_failed(e, "TangoApi_CANNOT_IMPORT_DEVICE",
							"Cannot import " + connection.devname,
							"Connection.build_connection(" + connection.devname + ")");
		    		}
				}
	    	}
		}
    }
1081610
public static synchronized AccountManager getInstance(XMPPConnection connection) {
        AccountManager accountManager = INSTANCES.get(connection);
        if (accountManager == null) {
            accountManager = new AccountManager(connection);
            INSTANCES.put(connection, accountManager);
        }
        return accountManager;
    }
667545
public Connection createConnectionProxy(Connection connection) {
		assert connection != null;
		// même si le counter sql n'est pas affiché on crée un proxy de la connexion
		// pour avoir les graphiques USED_CONNECTION_COUNT et ACTIVE_CONNECTION_COUNT (cf issue 160)
		if (isMonitoringDisabled()) {
			return connection;
		}
		final ConnectionInvocationHandler invocationHandler = new ConnectionInvocationHandler(
				connection);
		final Connection result = createProxy(connection, invocationHandler);
		if (result != connection) {
			invocationHandler.init();
		}
		return result;
	}
225719
public void addConnection(ServerSentEventConnection connection) {
        Objects.requireNonNull(connection, Required.CONNECTION.toString());

        final String url = RequestUtils.getServerSentEventURL(connection);
        Set<ServerSentEventConnection> uriConnections = getConnections(url);
        if (uriConnections == null) {
            uriConnections = new HashSet<>();
            uriConnections.add(connection);
        } else {
            uriConnections.add(connection);
        }
        setConnections(url, uriConnections);
    }
1179569
public static ConfigurableConnection of(Connection connection) {
    Assert.isTrue(connection instanceof ConfigurableConnection, "The connection {} was not created by Lyra", connection);
    return (ConfigurableConnection) connection;
  }
1188973
public <R> Connection<CL> getConnectionForOperation(BaseOperation<CL, R> baseOperation) {
	return selectionStrategy.getConnection(baseOperation, cpConfiguration.getMaxTimeoutWhenExhausted(),
		TimeUnit.MILLISECONDS);
    }
1347623
public static synchronized BoBManager getInstanceFor(XMPPConnection connection) {
        BoBManager bobManager = INSTANCES.get(connection);
        if (bobManager == null) {
            bobManager = new BoBManager(connection);
            INSTANCES.put(connection, bobManager);
        }

        return bobManager;
    }
1210489
public static synchronized ChatManager getInstanceFor(XMPPConnection connection) {
        ChatManager manager = INSTANCES.get(connection);
        if (manager == null)
            manager = new ChatManager(connection);
        return manager;
    }
1325625
@SuppressWarnings("unchecked")
  private InputConnection setupConnection(InputConnection connection) {
    log.debug(String.format("%s - Setting up connection: %s", this, connection));
    connection.messageHandler(messageHandler);
    for (Handler<InputBatch> handler : batchHandlers) {
      connection.batchHandler(handler);
    }
    if (groupHandler != null) {
      connection.groupHandler(groupHandler);
    }
    for (Map.Entry<String, Handler<InputGroup>> entry : groupHandlers.entrySet()) {
      connection.groupHandler(entry.getKey(), entry.getValue());
    }
    if (paused) {
      connection.pause();
    }
    return connection;
  }
722798
public static synchronized MultiUserChatManager getInstanceFor(XMPPConnection connection) {
        MultiUserChatManager multiUserChatManager = INSTANCES.get(connection);
        if (multiUserChatManager == null) {
            multiUserChatManager = new MultiUserChatManager(connection);
            INSTANCES.put(connection, multiUserChatManager);
        }
        return multiUserChatManager;
    }
232195
CompletableFuture<Void> connect(LocalConnection connection) {
    LocalConnection localConnection = new LocalConnection(listener.context, connections);
    connections.add(localConnection);
    connection.connect(localConnection);
    localConnection.connect(connection);
    return CompletableFuture.runAsync(() -> listener.listener.accept(localConnection), listener.context.executor());
  }
1244819
public static synchronized DeliveryReceiptManager getInstanceFor(XMPPConnection connection) {
        DeliveryReceiptManager receiptManager = instances.get(connection);

        if (receiptManager == null) {
            receiptManager = new DeliveryReceiptManager(connection);
            instances.put(connection, receiptManager);
        }

        return receiptManager;
    }
1043058
public List<Jid> getOccupiedRooms(DomainBareJid mucLightService)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        DiscoverItems result = ServiceDiscoveryManager.getInstanceFor(connection()).discoverItems(mucLightService);
        List<DiscoverItems.Item> items = result.getItems();
        List<Jid> answer = new ArrayList<>(items.size());

        for (DiscoverItems.Item item : items) {
            Jid mucLight = item.getEntityID();
            answer.add(mucLight);
        }

        return answer;
    }