@Override
    public PoolableConnection getConnection(
        final String uri,
        final String user,
        final char[] password
    ) {
        requireNonNull(uri);
        // user nullable
        // password nullable
        LOGGER_CONNECTION.debug("getConnection(%s, %s, *****)", uri, user);
        final String key = makeKey(uri, user, password);
        final Deque<PoolableConnection> q = acquireDeque(key);
        final PoolableConnection reusedConnection = pollValidOrNull(q);
        if (reusedConnection != null) {
            LOGGER_CONNECTION.debug("Reuse Connection: %s", reusedConnection);
            return lease(reusedConnection);
        } else {
            final Connection newRawConnection = newConnection(uri, user, password);
            final PoolableConnection newConnection = new PoolableConnectionImpl(uri, user, password, newRawConnection, System.currentTimeMillis() + getMaxAge());
            newConnection.setOnClose(() -> returnConnection(newConnection));
            LOGGER_CONNECTION.debug("New Connection: %s", newConnection);
            return lease(newConnection);
        }
    }
A fully concurrent implementation of a connection pool.

@author Per Minborg
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/internal/component/ConnectionPoolComponentImpl.java