Top Description Fields Constructors Methods
org.apache.commons.pool2.impl

public Class EvictionConfig

extends Object
Class Inheritance
Imports
java.time.Duration

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

Field Summary

Modifier and TypeField and Description
private final Duration
private final Duration
private static final Duration
private final int

Constructor Summary

AccessConstructor and Description
public
EvictionConfig(final Duration idleEvictDuration, final Duration idleSoftEvictDuration, final int minIdle)

Creates a new eviction configuration with the specified parameters.

public
EvictionConfig(final long poolIdleEvictMillis, final long poolIdleSoftEvictMillis, final int minIdle)

Creates a new eviction configuration with the specified parameters.

Method Summary

Modifier and TypeMethod and Description
public Duration

Returns:

The idleEvictTime.
getIdleEvictDuration
()

Gets the idleEvictTime for this eviction configuration instance.

public long

Returns:

The idleEvictTime in milliseconds
getIdleEvictTime
()

Deprecated Use getIdleEvictDuration().
Gets the idleEvictTime for this eviction configuration instance.
public Duration

Returns:

The idleEvictTime.
getIdleEvictTimeDuration
()

Deprecated Use getIdleEvictDuration().
Gets the idleEvictTime for this eviction configuration instance.
public Duration

Returns:

The (@code idleSoftEvictTime} in milliseconds
getIdleSoftEvictDuration
()

Gets the idleSoftEvictTime for this eviction configuration instance.

public long

Returns:

The (@code idleSoftEvictTime} in milliseconds
getIdleSoftEvictTime
()

Deprecated Use getIdleSoftEvictDuration().
Gets the idleSoftEvictTime for this eviction configuration instance.
public Duration

Returns:

The (@code idleSoftEvictTime} in milliseconds
getIdleSoftEvictTimeDuration
()

Deprecated Use getIdleSoftEvictDuration().
Gets the idleSoftEvictTime for this eviction configuration instance.
public int

Returns:

The minIdle
getMinIdle
()

Gets the minIdle for this eviction configuration instance.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

idleEvictDurationback to summary
private final Duration idleEvictDuration
idleSoftEvictDurationback to summary
private final Duration idleSoftEvictDuration
MAX_DURATIONback to summary
private static final Duration MAX_DURATION
minIdleback to summary
private final int minIdle

Constructor Detail

EvictionConfigback to summary
public EvictionConfig(final Duration idleEvictDuration, final Duration idleSoftEvictDuration, final int minIdle)

Creates a new eviction configuration with the specified parameters. Instances are immutable.

Parameters
idleEvictDuration:Duration

Expected to be provided by BaseGenericObjectPool#getMinEvictableIdleDuration()

idleSoftEvictDuration:Duration

Expected to be provided by BaseGenericObjectPool#getSoftMinEvictableIdleDuration()

minIdle:int

Expected to be provided by GenericObjectPool#getMinIdle() or GenericKeyedObjectPool#getMinIdlePerKey()

Since
2.10.0
EvictionConfigback to summary
public EvictionConfig(final long poolIdleEvictMillis, final long poolIdleSoftEvictMillis, final int minIdle)

Creates a new eviction configuration with the specified parameters. Instances are immutable.

Parameters
poolIdleEvictMillis:long

Expected to be provided by BaseGenericObjectPool#getMinEvictableIdleDuration()

poolIdleSoftEvictMillis:long

Expected to be provided by BaseGenericObjectPool#getSoftMinEvictableIdleDuration()

minIdle:int

Expected to be provided by GenericObjectPool#getMinIdle() or GenericKeyedObjectPool#getMinIdlePerKey()

Annotations
@Deprecated

Method Detail

getIdleEvictDurationback to summary
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:Duration

The idleEvictTime.

Since
2.11.0
getIdleEvictTimeback to summary
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:long

The idleEvictTime in milliseconds

Annotations
@Deprecated
getIdleEvictTimeDurationback to summary
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:Duration

The idleEvictTime.

Annotations
@Deprecated
Since
2.10.0
getIdleSoftEvictDurationback to summary
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:Duration

The (@code idleSoftEvictTime} in milliseconds

Since
2.11.0
getIdleSoftEvictTimeback to summary
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:long

The (@code idleSoftEvictTime} in milliseconds

Annotations
@Deprecated
getIdleSoftEvictTimeDurationback to summary
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:Duration

The (@code idleSoftEvictTime} in milliseconds

Annotations
@Deprecated
getMinIdleback to summary
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:int

The minIdle

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
Since
2.4