EvictionConfig (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.tomcat.dbcp.pool2.impl, class: EvictionConfig

# Class EvictionConfig

java.lang.Object
org.apache.tomcat.dbcp.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
  Description
  `EvictionConfig(long poolIdleEvictMillis, long poolIdleSoftEvictMillis, int minIdle)`
  Deprecated.
  Use `EvictionConfig(Duration, Duration, int)`.
  `EvictionConfig(Duration idleEvictDuration, Duration idleSoftEvictDuration, int minIdle)`
  Creates a new eviction configuration with the specified parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Duration`
  `getIdleEvictDuration()`
  Gets the `idleEvictTime` for this eviction configuration instance.
  `long`
  `getIdleEvictTime()`
  Deprecated.
  Use `getIdleEvictDuration()`.
  `Duration`
  `getIdleEvictTimeDuration()`
  Deprecated.
  Use `getIdleEvictDuration()`.
  `Duration`
  `getIdleSoftEvictDuration()`
  Gets the `idleSoftEvictTime` for this eviction configuration instance.
  `long`
  `getIdleSoftEvictTime()`
  Deprecated.
  Use `getIdleSoftEvictDuration()`.
  `Duration`
  `getIdleSoftEvictTimeDuration()`
  Deprecated.
  Use `getIdleSoftEvictDuration()`.
  `int`
  `getMinIdle()`
  Gets the `minIdle` for this eviction configuration instance.
  `String`
  `toString()`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### EvictionConfig

    public EvictionConfig(Duration idleEvictDuration, Duration idleSoftEvictDuration, int minIdle)
    Creates a new eviction configuration with the specified parameters. Instances are immutable.
    Parameters:
      `idleEvictDuration` - Expected to be provided by `BaseGenericObjectPool.getMinEvictableIdleDuration()`
      `idleSoftEvictDuration` - Expected to be provided by `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()`
      `minIdle` - Expected to be provided by `GenericObjectPool.getMinIdle()` or `GenericKeyedObjectPool.getMinIdlePerKey()`
    Since:
      2.10.0

  - ### EvictionConfig

    @Deprecated public EvictionConfig(long poolIdleEvictMillis, long poolIdleSoftEvictMillis, int minIdle)
    Deprecated.
    Use `EvictionConfig(Duration, Duration, int)`.
    Creates a new eviction configuration with the specified parameters. Instances are immutable.
    Parameters:
      `poolIdleEvictMillis` - Expected to be provided by `BaseGenericObjectPool.getMinEvictableIdleDuration()`
      `poolIdleSoftEvictMillis` - Expected to be provided by `BaseGenericObjectPool.getSoftMinEvictableIdleDuration()`
      `minIdle` - Expected to be provided by `GenericObjectPool.getMinIdle()` or `GenericKeyedObjectPool.getMinIdlePerKey()`

- ## Method Details

  - ### getIdleEvictDuration

    public Duration getIdleEvictDuration()
    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.11.0

  - ### getIdleEvictTime

    @Deprecated public long getIdleEvictTime()
    Deprecated.
    Use `getIdleEvictDuration()`.
    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

    @Deprecated public Duration getIdleEvictTimeDuration()
    Deprecated.
    Use `getIdleEvictDuration()`.
    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

  - ### getIdleSoftEvictDuration

    public Duration getIdleSoftEvictDuration()
    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
    Since:
      2.11.0

  - ### getIdleSoftEvictTime

    @Deprecated public long getIdleSoftEvictTime()
    Deprecated.
    Use `getIdleSoftEvictDuration()`.
    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

    @Deprecated public Duration getIdleSoftEvictTimeDuration()
    Deprecated.
    Use `getIdleSoftEvictDuration()`.
    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