List of usage examples for org.apache.http.impl.conn CPoolEntry isRouteComplete
public boolean isRouteComplete()
From source file:org.apache.http.impl.conn.PoolingHttpClientConnectionManager.java
public void releaseConnection(final HttpClientConnection managedConn, final Object state, final long keepalive, final TimeUnit tunit) { Args.notNull(managedConn, "Managed connection"); synchronized (managedConn) { final CPoolEntry entry = CPoolProxy.detach(managedConn); if (entry == null) { return; }/* w w w.j av a 2 s .c o m*/ final ManagedHttpClientConnection conn = entry.getConnection(); try { if (conn.isOpen()) { entry.setState(state); entry.updateExpiry(keepalive, tunit != null ? tunit : TimeUnit.MILLISECONDS); if (this.log.isDebugEnabled()) { final String s; if (keepalive > 0) { s = "for " + (double) keepalive / 1000 + " seconds"; } else { s = "indefinitely"; } this.log.debug("Connection " + format(entry) + " can be kept alive " + s); } } } finally { this.pool.release(entry, conn.isOpen() && entry.isRouteComplete()); if (this.log.isDebugEnabled()) { this.log.debug("Connection released: " + format(entry) + formatStats(entry.getRoute())); } } } }