Package org.apache.hc.client5.http.io
Interface LeaseRequest
-
- All Superinterfaces:
org.apache.hc.core5.concurrent.Cancellable
public interface LeaseRequest extends org.apache.hc.core5.concurrent.CancellableRepresents a request for aConnectionEndpointwhose life cycle is managed by a connection manager.- Since:
- 5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConnectionEndpointget(org.apache.hc.core5.util.Timeout timeout)ReturnsConnectionEndpointwithin a given time.
-
-
-
Method Detail
-
get
ConnectionEndpoint get(org.apache.hc.core5.util.Timeout timeout) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
ReturnsConnectionEndpointwithin 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 operation timeout.- Returns:
- a connection that can be used to communicate along the given route
- Throws:
java.util.concurrent.TimeoutException- in case of a timeoutjava.lang.InterruptedException- if the calling thread is interrupted while waitingjava.util.concurrent.ExecutionException
-
-