Top Description Methods
org.apache.http.conn

public Interface ConnectionRequest

extends Cancellable
Imports
java.util.concurrent.ExecutionException, .TimeUnit, org.apache.http.HttpClientConnection, org.apache.http.concurrent.Cancellable

Represents a request for a HttpClientConnection whose life cycle is managed by a connection manager.
Since
4.3

Method Summary

Modifier and TypeMethod and Description
public HttpClientConnection

Returns:

a connection that can be used to communicate along the given route
get
(long
the timeout, 0 or negative for no timeout
timeout
,
TimeUnit
the unit for the timeout, may be null only if there is no timeout
timeUnit
)

Obtains a connection within a given time.

Inherited from org.apache.http.concurrent.Cancellable:
cancel

Method Detail

getback to summary
public HttpClientConnection get(long timeout, TimeUnit timeUnit) throws InterruptedException, ExecutionException, ConnectionPoolTimeoutException

Obtains a connection within a given time. This method will block until a connection becomes available, the timeout expires, or the connection manager is shut down. Timeouts are handled with millisecond precision. If cancel() is called while this is blocking or before this began, an InterruptedException will be thrown.

Parameters
timeout:long

the timeout, 0 or negative for no timeout

timeUnit:TimeUnit

the unit for the timeout, may be null only if there is no timeout

Returns:HttpClientConnection

a connection that can be used to communicate along the given route

Exceptions
InterruptedException:
if the calling thread is interrupted while waiting
ConnectionPoolTimeoutException:
in case of a timeout