Package org.apache.http.conn
Interface ConnectionRequest
-
- All Superinterfaces:
org.apache.http.concurrent.Cancellable
public interface ConnectionRequest extends org.apache.http.concurrent.CancellableRepresents a request for aHttpClientConnectionwhose life cycle is managed by a connection manager.- Since:
- 4.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.apache.http.HttpClientConnectionget(long timeout, java.util.concurrent.TimeUnit timeUnit)Obtains a connection within a given time.
-
-
-
Method Detail
-
get
org.apache.http.HttpClientConnection get(long timeout, java.util.concurrent.TimeUnit timeUnit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, ConnectionPoolTimeoutExceptionObtains 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. IfCancellable.cancel()is called while this is blocking or before this began, anInterruptedExceptionwill be thrown.- Parameters:
timeout- the timeout, 0 or negative for no timeouttimeUnit- the unit for thetimeout, may benullonly if there is no timeout- Returns:
- a connection that can be used to communicate along the given route
- Throws:
ConnectionPoolTimeoutException- in case of a timeoutjava.lang.InterruptedException- if the calling thread is interrupted while waitingjava.util.concurrent.ExecutionException
-
-