org.apache.jmeter.protocol.http.sampler.hc

## Class JMeterPoolingClientConnectionManager

- java.lang.Object
- - org.apache.jmeter.protocol.http.sampler.hc.JMeterPoolingClientConnectionManager

- All Implemented Interfaces:
    org.apache.http.conn.ClientConnectionManager, org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>
  Direct Known Subclasses:
    MeasuringConnectionManager

      public class JMeterPoolingClientConnectionManager
      extends java.lang.Object
      implements org.apache.http.conn.ClientConnectionManager, org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>

  Copy/Paste of `PoolingClientConnectionManager` with a slight modification extracted from `PoolingHttpClientConnectionManager` to allow using better validation mechanism introduced in 4.4 TODO : Remove when full upgrade to new HttpClient 4.5.X API is finished Internal class, DO NOT USE

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JMeterPoolingClientConnectionManager()`
    `JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schreg)`
    `JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schreg, org.apache.http.conn.DnsResolver dnsResolver)`
    `JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry, long timeToLive, java.util.concurrent.TimeUnit tunit)`
    `JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry, long timeToLive, java.util.concurrent.TimeUnit tunit, org.apache.http.conn.DnsResolver dnsResolver)`
    `JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry, long timeToLive, java.util.concurrent.TimeUnit tunit, org.apache.http.conn.DnsResolver dnsResolver, int validateAfterInactivity)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeExpiredConnections()`
    `void` | `closeIdleConnections(long idleTimeout, java.util.concurrent.TimeUnit tunit)`
    `protected org.apache.http.conn.ClientConnectionOperator` | `createConnectionOperator(org.apache.http.conn.scheme.SchemeRegistry schreg)` Hook for creating the connection operator.
    `protected void` | `finalize()`
    `int` | `getDefaultMaxPerRoute()`
    `protected org.apache.http.conn.DnsResolver` | `getDnsResolver()`
    `int` | `getMaxPerRoute(org.apache.http.conn.routing.HttpRoute route)`
    `int` | `getMaxTotal()`
    `org.apache.http.conn.scheme.SchemeRegistry` | `getSchemeRegistry()`
    `org.apache.http.pool.PoolStats` | `getStats(org.apache.http.conn.routing.HttpRoute route)`
    `org.apache.http.pool.PoolStats` | `getTotalStats()`
    `int` | `getValidateAfterInactivity()`
    `void` | `releaseConnection(org.apache.http.conn.ManagedClientConnection conn, long keepalive, java.util.concurrent.TimeUnit tunit)`
    `org.apache.http.conn.ClientConnectionRequest` | `requestConnection(org.apache.http.conn.routing.HttpRoute route, java.lang.Object state)`
    `void` | `setDefaultMaxPerRoute(int max)`
    `void` | `setMaxPerRoute(org.apache.http.conn.routing.HttpRoute route, int max)`
    `void` | `setMaxTotal(int max)`
    `void` | `setValidateAfterInactivity(int ms)` Defines period of inactivity in milliseconds after which persistent connections must be re-validated prior to being `leased` to the consumer.
    `void` | `shutdown()`

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

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

- - ### Constructor Detail

    - #### JMeterPoolingClientConnectionManager

          public JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schreg)

    - #### JMeterPoolingClientConnectionManager

          public JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schreg,
                                                      org.apache.http.conn.DnsResolver dnsResolver)

    - #### JMeterPoolingClientConnectionManager

          public JMeterPoolingClientConnectionManager()

    - #### JMeterPoolingClientConnectionManager

          public JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry,
                                                      long timeToLive,
                                                      java.util.concurrent.TimeUnit tunit)

    - #### JMeterPoolingClientConnectionManager

          public JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry,
                                                      long timeToLive,
                                                      java.util.concurrent.TimeUnit tunit,
                                                      org.apache.http.conn.DnsResolver dnsResolver)

    - #### JMeterPoolingClientConnectionManager

          public JMeterPoolingClientConnectionManager(org.apache.http.conn.scheme.SchemeRegistry schemeRegistry,
                                                      long timeToLive,
                                                      java.util.concurrent.TimeUnit tunit,
                                                      org.apache.http.conn.DnsResolver dnsResolver,
                                                      int validateAfterInactivity)

  - ### Method Detail

    - #### getValidateAfterInactivity

          public int getValidateAfterInactivity()

      Returns:
        configured period of inactivity in ms after which connections will be re-validated
      Since:
        4.5.2
      See Also:
        `setValidateAfterInactivity(int)`

    - #### setValidateAfterInactivity

          public void setValidateAfterInactivity(int ms)

      Defines period of inactivity in milliseconds after which persistent connections must be re-validated prior to being `leased` to the consumer. Non-positive value passed to this method disables connection validation. This check helps detect connections that have become stale (half-closed) while kept inactive in the pool.
      Parameters:
        `ms` - period of inactivity in ms
      Since:
        4.5.2
      See Also:
        `leaseConnection(java.util.concurrent.Future, long, java.util.concurrent.TimeUnit)`

    - #### finalize

          protected void finalize()
                           throws java.lang.Throwable

      Overrides:
        `finalize` in class `java.lang.Object`
      Throws:
        `java.lang.Throwable`

    - #### createConnectionOperator

          protected org.apache.http.conn.ClientConnectionOperator createConnectionOperator(org.apache.http.conn.scheme.SchemeRegistry schreg)

      Hook for creating the connection operator. It is called by the constructor. Derived classes can override this method to change the instantiation of the operator. The default implementation here instantiates `DefaultClientConnectionOperator`.
      Parameters:
        `schreg` - the scheme registry.
      Returns:
        the connection operator to use

    - #### getSchemeRegistry

          public org.apache.http.conn.scheme.SchemeRegistry getSchemeRegistry()

      Specified by:
        `getSchemeRegistry` in interface `org.apache.http.conn.ClientConnectionManager`

    - #### requestConnection

          public org.apache.http.conn.ClientConnectionRequest requestConnection(org.apache.http.conn.routing.HttpRoute route,
                                                                                java.lang.Object state)

      Specified by:
        `requestConnection` in interface `org.apache.http.conn.ClientConnectionManager`

    - #### releaseConnection

          public void releaseConnection(org.apache.http.conn.ManagedClientConnection conn,
                                        long keepalive,
                                        java.util.concurrent.TimeUnit tunit)

      Specified by:
        `releaseConnection` in interface `org.apache.http.conn.ClientConnectionManager`

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `org.apache.http.conn.ClientConnectionManager`

    - #### closeIdleConnections

          public void closeIdleConnections(long idleTimeout,
                                           java.util.concurrent.TimeUnit tunit)

      Specified by:
        `closeIdleConnections` in interface `org.apache.http.conn.ClientConnectionManager`

    - #### closeExpiredConnections

          public void closeExpiredConnections()

      Specified by:
        `closeExpiredConnections` in interface `org.apache.http.conn.ClientConnectionManager`

    - #### getMaxTotal

          public int getMaxTotal()

      Specified by:
        `getMaxTotal` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### setMaxTotal

          public void setMaxTotal(int max)

      Specified by:
        `setMaxTotal` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### getDefaultMaxPerRoute

          public int getDefaultMaxPerRoute()

      Specified by:
        `getDefaultMaxPerRoute` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### setDefaultMaxPerRoute

          public void setDefaultMaxPerRoute(int max)

      Specified by:
        `setDefaultMaxPerRoute` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### getMaxPerRoute

          public int getMaxPerRoute(org.apache.http.conn.routing.HttpRoute route)

      Specified by:
        `getMaxPerRoute` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### setMaxPerRoute

          public void setMaxPerRoute(org.apache.http.conn.routing.HttpRoute route,
                                     int max)

      Specified by:
        `setMaxPerRoute` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### getTotalStats

          public org.apache.http.pool.PoolStats getTotalStats()

      Specified by:
        `getTotalStats` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### getStats

          public org.apache.http.pool.PoolStats getStats(org.apache.http.conn.routing.HttpRoute route)

      Specified by:
        `getStats` in interface `org.apache.http.pool.ConnPoolControl<org.apache.http.conn.routing.HttpRoute>`

    - #### getDnsResolver

          protected org.apache.http.conn.DnsResolver getDnsResolver()

      Returns:
        the dnsResolver

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.