HTTPCLIENT-1760: added protected methods to enumerate leased and available connections to PoolingHttpClientConnectionManager

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1756278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2016-08-13 15:30:27 +00:00
parent 57bb51812e
commit 1b9c13afa9
2 changed files with 20 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.io.ManagedHttpClientConnection;
import org.apache.hc.core5.annotation.ThreadSafe;
import org.apache.hc.core5.pool.PoolEntryCallback;
import org.apache.hc.core5.pool.io.AbstractConnPool;
import org.apache.hc.core5.pool.io.ConnFactory;
@ -69,4 +70,14 @@ class CPool extends AbstractConnPool<HttpRoute, ManagedHttpClientConnection, CPo
return !entry.getConnection().isStale();
}
@Override
protected void enumAvailable(final PoolEntryCallback<HttpRoute, ManagedHttpClientConnection> callback) {
super.enumAvailable(callback);
}
@Override
protected void enumLeased(final PoolEntryCallback<HttpRoute, ManagedHttpClientConnection> callback) {
super.enumLeased(callback);
}
}

View File

@ -62,6 +62,7 @@ import org.apache.hc.core5.http.config.SocketConfig;
import org.apache.hc.core5.http.io.HttpClientConnection;
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.pool.ConnPoolControl;
import org.apache.hc.core5.pool.PoolEntryCallback;
import org.apache.hc.core5.pool.PoolStats;
import org.apache.hc.core5.pool.io.ConnFactory;
import org.apache.hc.core5.util.Args;
@ -419,6 +420,14 @@ public class PoolingHttpClientConnectionManager
this.pool.closeExpired();
}
protected void enumAvailable(final PoolEntryCallback<HttpRoute, ManagedHttpClientConnection> callback) {
this.pool.enumAvailable(callback);
}
protected void enumLeased(final PoolEntryCallback<HttpRoute, ManagedHttpClientConnection> callback) {
this.pool.enumLeased(callback);
}
@Override
public int getMaxTotal() {
return this.pool.getMaxTotal();