Top Description Methods
org.apache.hc.client5.http.io

public Interface LeaseRequest

extends Cancellable
Imports
java.util.concurrent.ExecutionException, .TimeoutException, org.apache.hc.core5.concurrent.Cancellable, org.apache.hc.core5.util.Timeout

Represents a request for a ConnectionEndpoint whose life cycle is managed by a connection manager.
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public ConnectionEndpoint

Returns:

a connection that can be used to communicate along the given route
get
(Timeout
the operation timeout.
timeout
)

Returns ConnectionEndpoint within a given time.

Inherited from org.apache.hc.core5.concurrent.Cancellable:
cancel

Method Detail

getback to summary
public ConnectionEndpoint get(Timeout timeout) throws InterruptedException, ExecutionException, TimeoutException

Returns ConnectionEndpoint 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:Timeout

the operation timeout.

Returns:ConnectionEndpoint

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

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