Package org.apache.http.impl.nio.pool
Class BasicNIOConnPool
- java.lang.Object
-
- org.apache.http.nio.pool.AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
-
- org.apache.http.impl.nio.pool.BasicNIOConnPool
-
- All Implemented Interfaces:
ConnPool<HttpHost,BasicNIOPoolEntry>
,ConnPoolControl<HttpHost>
@Contract(threading=SAFE) public class BasicNIOConnPool extends AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
A very basicConnPool
implementation that represents a pool of non-blockingNHttpClientConnection
connections identified by anHttpHost
instance. Please note this pool implementation does not support complex routes via a proxy cannot differentiate between direct and proxied connections.- Since:
- 4.2
- See Also:
HttpHost
-
-
Constructor Summary
Constructors Constructor Description BasicNIOConnPool(ConnectingIOReactor ioreactor)
BasicNIOConnPool(ConnectingIOReactor ioreactor, int connectTimeout, ConnectionConfig config)
BasicNIOConnPool(ConnectingIOReactor ioreactor, ConnectionConfig config)
BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, int connectTimeout)
BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, HttpParams params)
Deprecated.BasicNIOConnPool(ConnectingIOReactor ioreactor, HttpParams params)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.Future<BasicNIOPoolEntry>
lease(HttpHost route, java.lang.Object state)
java.util.concurrent.Future<BasicNIOPoolEntry>
lease(HttpHost route, java.lang.Object state, FutureCallback<BasicNIOPoolEntry> callback)
Attempts to lease a connection for the given route and with the given state from the pool.-
Methods inherited from class org.apache.http.nio.pool.AbstractNIOConnPool
closeExpired, closeIdle, getDefaultMaxPerRoute, getMaxPerRoute, getMaxTotal, getRoutes, getStats, getTotalStats, isShutdown, lease, lease, release, setDefaultMaxPerRoute, setMaxPerRoute, setMaxTotal, shutdown, toString, validatePendingRequests
-
-
-
-
Constructor Detail
-
BasicNIOConnPool
@Deprecated public BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, HttpParams params)
Deprecated.
-
BasicNIOConnPool
@Deprecated public BasicNIOConnPool(ConnectingIOReactor ioreactor, HttpParams params)
Deprecated.
-
BasicNIOConnPool
public BasicNIOConnPool(ConnectingIOReactor ioreactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, int connectTimeout)
- Since:
- 4.3
-
BasicNIOConnPool
public BasicNIOConnPool(ConnectingIOReactor ioreactor, int connectTimeout, ConnectionConfig config)
- Since:
- 4.3
-
BasicNIOConnPool
public BasicNIOConnPool(ConnectingIOReactor ioreactor, ConnectionConfig config)
- Since:
- 4.3
-
BasicNIOConnPool
public BasicNIOConnPool(ConnectingIOReactor ioreactor)
- Since:
- 4.3
-
-
Method Detail
-
lease
public java.util.concurrent.Future<BasicNIOPoolEntry> lease(HttpHost route, java.lang.Object state, FutureCallback<BasicNIOPoolEntry> callback)
Description copied from interface:ConnPool
Attempts to lease a connection for the given route and with the given state from the pool.- Specified by:
lease
in interfaceConnPool<HttpHost,BasicNIOPoolEntry>
- Overrides:
lease
in classAbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
- Parameters:
route
- route of the connection.state
- arbitrary object that represents a particular state (usually a security principal or a unique token identifying the user whose credentials have been used while establishing the connection). May benull
.callback
- operation completion callback.- Returns:
- future for a leased pool entry.
-
lease
public java.util.concurrent.Future<BasicNIOPoolEntry> lease(HttpHost route, java.lang.Object state)
- Overrides:
lease
in classAbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
-
-