org.apache.http.conn
Interface ConnectionRequest
- All Superinterfaces:
- Cancellable
public interface ConnectionRequest
- extends Cancellable
Represents a request for a HttpClientConnection whose life cycle
is managed by a connection manager.
- Since:
- 4.3
|
Method Summary |
org.apache.http.HttpClientConnection |
get(long timeout,
java.util.concurrent.TimeUnit tunit)
Obtains a connection within a given time. |
get
org.apache.http.HttpClientConnection get(long timeout,
java.util.concurrent.TimeUnit tunit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
org.apache.http.conn.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
Cancellable.cancel() is called while this is blocking or
before this began, an InterruptedException will
be thrown.
- Parameters:
timeout - the timeout, 0 or negative for no timeouttunit - the unit for the timeout,
may be null only if there is no timeout
- Returns:
- a connection that can be used to communicate
along the given route
- Throws:
ConnectionPoolTimeoutException - in case of a timeout
java.lang.InterruptedException - if the calling thread is interrupted while waiting
java.util.concurrent.ExecutionException