Top Description Methods
org.apache.hc.core5.pool

public Interface ConnPool<T, C extends org.apache.hc.core5.io.ModalCloseable>

Known Direct Subinterfaces
org.apache.hc.core5.pool.ManagedConnPool
Type Parameters
<T>
the route type that represents the opposite endpoint of a pooled connection.
<C>
the type of pooled connections.
Imports
java.util.concurrent.Future, org.apache.hc.core5.concurrent.FutureCallback, org.apache.hc.core5.io.ModalCloseable, org.apache.hc.core5.util.Timeout

ConnPool represents a shared pool connections can be leased from and released back to.
Since
4.2

Method Summary

Modifier and TypeMethod and Description
public Future<PoolEntry<T, C>>

Returns:

future for a leased pool entry.
lease
(T
route of the connection.
route
,
Object
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 be null.
state
,
Timeout
request timeout. In case of a timeout the request can get automatically cancelled by the pool.
requestTimeout
,
FutureCallback<PoolEntry<T, C>>
operation completion callback.
callback
)

Attempts to lease a connection for the given route and with the given state from the pool.

public void
release(PoolEntry<T, C>
pool entry leased from the pool
entry
,
boolean
flag indicating whether or not the released connection is in a consistent state and is safe for further use.
reusable
)

Releases the pool entry back to the pool.

Method Detail

leaseback to summary
public Future<PoolEntry<T, C>> lease(T route, Object state, Timeout requestTimeout, FutureCallback<PoolEntry<T, C>> callback)

Attempts to lease a connection for the given route and with the given state from the pool.

Please note the connection request can get automatically cancelled by the pool in case of a request timeout.

Parameters
route:T

route of the connection.

state:Object

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 be null.

requestTimeout:Timeout

request timeout. In case of a timeout the request can get automatically cancelled by the pool.

callback:FutureCallback<PoolEntry<T, C>>

operation completion callback.

Returns:Future<PoolEntry<T, C>>

future for a leased pool entry.

releaseback to summary
public void release(PoolEntry<T, C> entry, boolean reusable)

Releases the pool entry back to the pool.

Parameters
entry:PoolEntry<T, C>

pool entry leased from the pool

reusable:boolean

flag indicating whether or not the released connection is in a consistent state and is safe for further use.