org.apache.http.impl.client

## Class IdleConnectionEvictor

- java.lang.Object
- - org.apache.http.impl.client.IdleConnectionEvictor

-     public final class IdleConnectionEvictor
      extends Object

  This class maintains a background thread to enforce an eviction policy for expired / idle persistent connections kept alive in the connection pool.
  Since:
    4.4

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IdleConnectionEvictor(HttpClientConnectionManager connectionManager, long maxIdleTime, TimeUnit maxIdleTimeUnit)`
    `IdleConnectionEvictor(HttpClientConnectionManager connectionManager, long sleepTime, TimeUnit sleepTimeUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)`
    `IdleConnectionEvictor(HttpClientConnectionManager connectionManager, ThreadFactory threadFactory, long sleepTime, TimeUnit sleepTimeUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `awaitTermination(long time, TimeUnit timeUnit)`
    `boolean` | `isRunning()`
    `void` | `shutdown()`
    `void` | `start()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IdleConnectionEvictor

          public IdleConnectionEvictor(HttpClientConnectionManager connectionManager,
                               ThreadFactory threadFactory,
                               long sleepTime,
                               TimeUnit sleepTimeUnit,
                               long maxIdleTime,
                               TimeUnit maxIdleTimeUnit)

    - #### IdleConnectionEvictor

          public IdleConnectionEvictor(HttpClientConnectionManager connectionManager,
                               long sleepTime,
                               TimeUnit sleepTimeUnit,
                               long maxIdleTime,
                               TimeUnit maxIdleTimeUnit)

    - #### IdleConnectionEvictor

          public IdleConnectionEvictor(HttpClientConnectionManager connectionManager,
                               long maxIdleTime,
                               TimeUnit maxIdleTimeUnit)

  - ### Method Detail

    - #### start

          public void start()

    - #### shutdown

          public void shutdown()

    - #### isRunning

          public boolean isRunning()

    - #### awaitTermination

          public void awaitTermination(long time,
                              TimeUnit timeUnit)
                                throws InterruptedException

      Throws:
        `InterruptedException`

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