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.Cancellable

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

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConnectionEndpoint` | `get(org.apache.hc.core5.util.Timeout timeout)` Returns `ConnectionEndpoint` within a given time.

    - ### Methods inherited from interface org.apache.hc.core5.concurrent.Cancellable

      `cancel`

- - ### Method Detail

    - #### get

          ConnectionEndpoint get(org.apache.hc.core5.util.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 `Cancellable.cancel()` is called while this is blocking or before this began, an `InterruptedException` will be thrown.
      Parameters:
        `timeout` - the operation timeout.
      Returns:
        a connection that can be used to communicate along the given route
      Throws:
        `TimeoutException` - in case of a timeout
        `InterruptedException` - if the calling thread is interrupted while waiting
        `ExecutionException`

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.