In Apache httpclient 4.*, why all the methods are deprecated? If all are deprecated , how can we use this class effectively.
When I do a PoolingClientConnectionManager.getTotalStats()
I see the following output
[leased: 2; pending: 0; available: 0; max: 20], and I never see available being above 0 at any concurrency.
Please advise.
@Deprecated@Contract(threading=SAFE_CONDITIONAL) public class PoolingClientConnectionManager extends Object implements ClientConnectionManager, org.apache.http.pool.ConnPoolControl<HttpRoute> Manages a pool of OperatedClientConnectionand is able to service connection requests from multiple execution threads.
ClientConnectionManager.closeExpiredConnections() shutdown public void shutdown() Deprecated. Description copied from interface: ClientConnectionManager Shuts down this connection manager and releases allocated resources. This includes closing all connections, whether they are currently used or not. Specified by:
public void closeExpiredConnections() Deprecated. Description copied from interface: ClientConnectionManager Closes all expired connections in the pool. Open connections in the pool that have not been used for the timespan defined when the connection was released will be closed. Currently allocated connections are not subject to this method.
ClientConnectionPoolManager maintains a maximum limit of connection on a per route basis and in total. Per default this implementation will create no more than than 2 concurrent connections per given route and no more 20 connections in total.
http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/PoolingClientConnectionManager.html
The class PoolingClientConnectionManager
itself is deprecated, so all methods are deprecated. Don't use the class. Instead, use PoolingHttpClientConnectionManager
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With