org.apache.commons.pool2.impl

## Class EvictionConfig

- java.lang.Object
- - org.apache.commons.pool2.impl.EvictionConfig

-     public class EvictionConfig
      extends Object

  This class is used by pool implementations to pass configuration information to `EvictionPolicy` instances. The `EvictionPolicy` may also have its own specific configuration attributes.

  This class is immutable and thread-safe.

  Since:
    2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EvictionConfig(Duration poolIdleEvictTime, Duration poolIdleSoftEvictTime, int minIdle)` Creates a new eviction configuration with the specified parameters.
    `EvictionConfig(long poolIdleEvictTime, long poolIdleSoftEvictTime, int minIdle)` Deprecated. Use `EvictionConfig(Duration, Duration, int)`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getIdleEvictTime()` Gets the `idleEvictTime` for this eviction configuration instance.
    `Duration` | `getIdleEvictTimeDuration()` Gets the `idleEvictTime` for this eviction configuration instance.
    `long` | `getIdleSoftEvictTime()` Gets the `idleSoftEvictTime` for this eviction configuration instance.
    `Duration` | `getIdleSoftEvictTimeDuration()` Gets the `idleSoftEvictTime` for this eviction configuration instance.
    `int` | `getMinIdle()` Gets the `minIdle` for this eviction configuration instance.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### EvictionConfig

          public EvictionConfig(Duration poolIdleEvictTime,
                                Duration poolIdleSoftEvictTime,
                                int minIdle)

      Creates a new eviction configuration with the specified parameters. Instances are immutable.
      Parameters:
        `poolIdleEvictTime` - Expected to be provided by `BaseGenericObjectPool.getMinEvictableIdleTimeMillis()`
        `poolIdleSoftEvictTime` - Expected to be provided by `BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()`
        `minIdle` - Expected to be provided by `GenericObjectPool.getMinIdle()` or `GenericKeyedObjectPool.getMinIdlePerKey()`
      Since:
        2.10.0

    - #### EvictionConfig

          @Deprecated
          public EvictionConfig(long poolIdleEvictTime,
                                            long poolIdleSoftEvictTime,
                                            int minIdle)

      Deprecated. Use `EvictionConfig(Duration, Duration, int)`.
      Creates a new eviction configuration with the specified parameters. Instances are immutable.
      Parameters:
        `poolIdleEvictTime` - Expected to be provided by `BaseGenericObjectPool.getMinEvictableIdleTimeMillis()`
        `poolIdleSoftEvictTime` - Expected to be provided by `BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()`
        `minIdle` - Expected to be provided by `GenericObjectPool.getMinIdle()` or `GenericKeyedObjectPool.getMinIdlePerKey()`

  - ### Method Detail

    - #### getIdleEvictTime

          public long getIdleEvictTime()

      Gets the `idleEvictTime` for this eviction configuration instance.

      How the evictor behaves based on this value will be determined by the configured `EvictionPolicy`.

      Returns:
        The `idleEvictTime` in milliseconds

    - #### getIdleEvictTimeDuration

          public Duration getIdleEvictTimeDuration()

      Gets the `idleEvictTime` for this eviction configuration instance.

      How the evictor behaves based on this value will be determined by the configured `EvictionPolicy`.

      Returns:
        The `idleEvictTime`.
      Since:
        2.10.0

    - #### getIdleSoftEvictTime

          public long getIdleSoftEvictTime()

      Gets the `idleSoftEvictTime` for this eviction configuration instance.

      How the evictor behaves based on this value will be determined by the configured `EvictionPolicy`.

      Returns:
        The (@code idleSoftEvictTime} in milliseconds

    - #### getIdleSoftEvictTimeDuration

          public Duration getIdleSoftEvictTimeDuration()

      Gets the `idleSoftEvictTime` for this eviction configuration instance.

      How the evictor behaves based on this value will be determined by the configured `EvictionPolicy`.

      Returns:
        The (@code idleSoftEvictTime} in milliseconds

    - #### getMinIdle

          public int getMinIdle()

      Gets the `minIdle` for this eviction configuration instance.

      How the evictor behaves based on this value will be determined by the configured `EvictionPolicy`.

      Returns:
        The `minIdle`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`
      Since:
        2.4

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