/** * Indicates that the provided connection should be removed from the pool, * and that no new connection should be created to take its place. This may * be used to shrink the pool if such functionality is desired. * * @param connection The connection to be discarded. */ public void discardConnection(final LDAPConnection connection) { if (connection == null) { return; } connection.setDisconnectInfo(DisconnectType.POOLED_CONNECTION_UNNEEDED, null, null); connection.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); if (availableConnections.remainingCapacity() > 0) { final int newReplaceCount = failedReplaceCount.incrementAndGet(); if (newReplaceCount > numConnections) { failedReplaceCount.set(numConnections); } } }
/** * Indicates that the provided connection should be removed from the pool, * and that no new connection should be created to take its place. This may * be used to shrink the pool if such functionality is desired. * * @param connection The connection to be discarded. */ public void discardConnection(final LDAPConnection connection) { if (connection == null) { return; } connection.setDisconnectInfo(DisconnectType.POOLED_CONNECTION_UNNEEDED, null, null); connection.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); if (availableConnections.remainingCapacity() > 0) { final int newReplaceCount = failedReplaceCount.incrementAndGet(); if (newReplaceCount > numConnections) { failedReplaceCount.set(numConnections); } } }
iterator.remove(); poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.setDisconnectInfo(DisconnectType.POOL_CLOSED, null, null); if (unbind)
poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.setDisconnectInfo(DisconnectType.POOL_CLOSED, null, null); if (unbind)
poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.setDisconnectInfo(DisconnectType.POOL_CLOSED, null, null); if (unbind)
/** * Closes the connection. */ public void run() { final AbstractConnectionPool pool = connection.getConnectionPool(); if (pool != null) { final LDAPConnectionPoolStatistics stats = pool.getConnectionPoolStatistics(); if (stats != null) { stats.incrementNumConnectionsClosedUnneeded(); } } connection.setDisconnectInfo(DisconnectType.POOL_CLOSED, null, null); if (unbind) { connection.terminate(null); } else { connection.setClosed(); } } }
/** * Closes the connection. */ public void run() { final AbstractConnectionPool pool = connection.getConnectionPool(); if (pool != null) { final LDAPConnectionPoolStatistics stats = pool.getConnectionPoolStatistics(); if (stats != null) { stats.incrementNumConnectionsClosedUnneeded(); } } connection.setDisconnectInfo(DisconnectType.POOL_CLOSED, null, null); if (unbind) { connection.terminate(null); } else { connection.setClosed(); } } }
DisconnectType.POOLED_CONNECTION_UNNEEDED, null, null); newConnection.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); poolStatistics.incrementNumConnectionsClosedUnneeded(); connection.terminate(null); return;
DisconnectType.POOLED_CONNECTION_UNNEEDED, null, null); newConnection.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); poolStatistics.incrementNumConnectionsClosedUnneeded(); connection.terminate(null); return;
poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.terminate(null); DisconnectType.POOLED_CONNECTION_UNNEEDED, null, null); newConnection.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.terminate(null); break;
poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.terminate(null); DisconnectType.POOLED_CONNECTION_UNNEEDED, null, null); newConnection.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.terminate(null); poolStatistics.incrementNumConnectionsClosedUnneeded(); conn.terminate(null); break;