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

public abstract Class BaseObjectPoolConfig<T>

extends BaseObject
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Known Direct Subclasses
org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig, org.apache.commons.pool2.impl.GenericObjectPoolConfig
Type Parameters
<T>
Type of element pooled.
Imports
java.time.Duration, org.apache.commons.pool2.BaseObject

Provides the implementation for the common attributes shared by the sub-classes. New instances of this class will be created using the defaults defined by the public constants.

This class is not thread-safe.

Since
2.0

Field Summary

Modifier and TypeField and Description
private boolean
public static final boolean
DEFAULT_BLOCK_WHEN_EXHAUSTED

The default value for the blockWhenExhausted configuration attribute.

public static final Duration
DEFAULT_DURATION_BETWEEN_EVICTION_RUNS

The default value for the timeBetweenEvictionRuns configuration attribute.

public static final String
DEFAULT_EVICTION_POLICY_CLASS_NAME

The default value for the evictionPolicyClassName configuration attribute.

public static final Duration
DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT

The default value for evictorShutdownTimeout configuration attribute.

public static final long
DEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLIS

The default value for evictorShutdownTimeout configuration attribute.

public static final boolean
DEFAULT_FAIRNESS

The default value for the fairness configuration attribute.

public static final boolean
DEFAULT_JMX_ENABLE

The default value for enabling JMX for pools created with a configuration instance.

public static final String
DEFAULT_JMX_NAME_BASE

The default value for the base name to use to name JMX enabled pools created with a configuration instance.

public static final String
DEFAULT_JMX_NAME_PREFIX

The default value for the prefix used to name JMX enabled pools created with a configuration instance.

public static final boolean
DEFAULT_LIFO

The default value for the lifo configuration attribute.

public static final Duration
DEFAULT_MAX_WAIT

The default value for the maxWait configuration attribute.

public static final long
DEFAULT_MAX_WAIT_MILLIS

The default value for the maxWait configuration attribute.

public static final Duration
DEFAULT_MIN_EVICTABLE_IDLE_DURATION

The default value for the minEvictableIdleDuration configuration attribute.

public static final Duration
DEFAULT_MIN_EVICTABLE_IDLE_TIME

The default value for the minEvictableIdleDuration configuration attribute.

public static final long
DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS

The default value for the minEvictableIdleDuration configuration attribute.

public static final int
DEFAULT_NUM_TESTS_PER_EVICTION_RUN

The default value for the numTestsPerEvictionRun configuration attribute.

public static final Duration
DEFAULT_SOFT_MIN_EVICTABLE_IDLE_DURATION

The default value for the softMinEvictableIdleTime configuration attribute.

public static final Duration
DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME

The default value for the softMinEvictableIdleTime configuration attribute.

public static final long
DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS

The default value for the softMinEvictableIdleTime configuration attribute.

public static final boolean
DEFAULT_TEST_ON_BORROW

The default value for the testOnBorrow configuration attribute.

public static final boolean
DEFAULT_TEST_ON_CREATE

The default value for the testOnCreate configuration attribute.

public static final boolean
DEFAULT_TEST_ON_RETURN

The default value for the testOnReturn configuration attribute.

public static final boolean
DEFAULT_TEST_WHILE_IDLE

The default value for the testWhileIdle configuration attribute.

public static final Duration
DEFAULT_TIME_BETWEEN_EVICTION_RUNS

The default value for the timeBetweenEvictionRuns configuration attribute.

public static final long
DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS

The default value for the timeBetweenEvictionRuns configuration attribute.

private Duration
private EvictionPolicy<T>
private String
private Duration
private boolean
private boolean
private String
private String
private boolean
private Duration
private Duration
private int
private Duration
private boolean
private boolean
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

The current setting of blockWhenExhausted for this configuration instance
getBlockWhenExhausted
()

Gets the value for the blockWhenExhausted configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of timeBetweenEvictionRuns for this configuration instance
getDurationBetweenEvictionRuns
()

Gets the value for the timeBetweenEvictionRuns configuration attribute for pools created with this configuration instance.

public EvictionPolicy<T>

Returns:

The current setting of evictionPolicyClass for this configuration instance
getEvictionPolicy
()

Gets the value for the evictionPolicyClass configuration attribute for pools created with this configuration instance.

public String

Returns:

The current setting of evictionPolicyClassName for this configuration instance
getEvictionPolicyClassName
()

Gets the value for the evictionPolicyClassName configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of evictorShutdownTimeout for this configuration instance
getEvictorShutdownTimeout
()

Gets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance.
public Duration

Returns:

The current setting of evictorShutdownTimeout for this configuration instance
getEvictorShutdownTimeoutDuration
()

Gets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance.

public long

Returns:

The current setting of evictorShutdownTimeout for this configuration instance
getEvictorShutdownTimeoutMillis
()

Deprecated Use getEvictorShutdownTimeout().
Gets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance.
public boolean

Returns:

The current setting of fairness for this configuration instance
getFairness
()

Gets the value for the fairness configuration attribute for pools created with this configuration instance.

public boolean

Returns:

The current setting of jmxEnabled for this configuration instance
getJmxEnabled
()

Gets the value of the flag that determines if JMX will be enabled for pools created with this configuration instance.

public String

Returns:

The current setting of jmxNameBase for this configuration instance
getJmxNameBase
()

Gets the value of the JMX name base that will be used as part of the name assigned to JMX enabled pools created with this configuration instance.

public String

Returns:

The current setting of jmxNamePrefix for this configuration instance
getJmxNamePrefix
()

Gets the value of the JMX name prefix that will be used as part of the name assigned to JMX enabled pools created with this configuration instance.

public boolean

Returns:

The current setting of lifo for this configuration instance
getLifo
()

Gets the value for the lifo configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of maxWait for this configuration instance
getMaxWaitDuration
()

Gets the value for the maxWait configuration attribute for pools created with this configuration instance.

public long

Returns:

The current setting of maxWait for this configuration instance
getMaxWaitMillis
()

Deprecated Use getMaxWaitDuration().
Gets the value for the maxWait configuration attribute for pools created with this configuration instance.
public Duration

Returns:

The current setting of minEvictableIdleTime for this configuration instance
getMinEvictableIdleDuration
()

Gets the value for the minEvictableIdleTime configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of minEvictableIdleTime for this configuration instance
getMinEvictableIdleTime
()

Gets the value for the minEvictableIdleTime configuration attribute for pools created with this configuration instance.
public long

Returns:

The current setting of minEvictableIdleTime for this configuration instance
getMinEvictableIdleTimeMillis
()

Deprecated Use getMinEvictableIdleTime().
Gets the value for the minEvictableIdleTime configuration attribute for pools created with this configuration instance.
public int

Returns:

The current setting of numTestsPerEvictionRun for this configuration instance
getNumTestsPerEvictionRun
()

Gets the value for the numTestsPerEvictionRun configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of softMinEvictableIdleTime for this configuration instance
getSoftMinEvictableIdleDuration
()

Gets the value for the softMinEvictableIdleTime configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of softMinEvictableIdleTime for this configuration instance
getSoftMinEvictableIdleTime
()

Gets the value for the softMinEvictableIdleTime configuration attribute for pools created with this configuration instance.
public long

Returns:

The current setting of softMinEvictableIdleTime for this configuration instance
getSoftMinEvictableIdleTimeMillis
()

Gets the value for the softMinEvictableIdleTime configuration attribute for pools created with this configuration instance.
public boolean

Returns:

The current setting of testOnBorrow for this configuration instance
getTestOnBorrow
()

Gets the value for the testOnBorrow configuration attribute for pools created with this configuration instance.

public boolean

Returns:

The current setting of testOnCreate for this configuration instance
getTestOnCreate
()

Gets the value for the testOnCreate configuration attribute for pools created with this configuration instance.

public boolean

Returns:

The current setting of testOnReturn for this configuration instance
getTestOnReturn
()

Gets the value for the testOnReturn configuration attribute for pools created with this configuration instance.

public boolean

Returns:

The current setting of testWhileIdle for this configuration instance
getTestWhileIdle
()

Gets the value for the testWhileIdle configuration attribute for pools created with this configuration instance.

public Duration

Returns:

The current setting of timeBetweenEvictionRuns for this configuration instance
getTimeBetweenEvictionRuns
()

Gets the value for the timeBetweenEvictionRuns configuration attribute for pools created with this configuration instance.
public long

Returns:

The current setting of timeBetweenEvictionRuns for this configuration instance
getTimeBetweenEvictionRunsMillis
()

Gets the value for the timeBetweenEvictionRuns configuration attribute for pools created with this configuration instance.
public void
setBlockWhenExhausted(final boolean
The new setting of blockWhenExhausted for this configuration instance
blockWhenExhausted
)

Sets the value for the blockWhenExhausted configuration attribute for pools created with this configuration instance.

public void
setEvictionPolicy(final EvictionPolicy<T>
The new setting of evictionPolicyClass for this configuration instance
evictionPolicy
)

Sets the value for the evictionPolicyClass configuration attribute for pools created with this configuration instance.

public void
setEvictionPolicyClassName(final String
The new setting of evictionPolicyClassName for this configuration instance
evictionPolicyClassName
)

Sets the value for the evictionPolicyClassName configuration attribute for pools created with this configuration instance.

public void
setEvictorShutdownTimeout(final Duration
The new setting of evictorShutdownTimeout for this configuration instance
evictorShutdownTimeoutDuration
)

Sets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance.

public void
setEvictorShutdownTimeoutMillis(final Duration
The new setting of evictorShutdownTimeout for this configuration instance
evictorShutdownTimeout
)

Sets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance.
public void
setEvictorShutdownTimeoutMillis(final long
The new setting of evictorShutdownTimeout for this configuration instance
evictorShutdownTimeoutMillis
)

Sets the value for the evictorShutdownTimeout configuration attribute for pools created with this configuration instance.
public void
setFairness(final boolean
The new setting of fairness for this configuration instance
fairness
)

Sets the value for the fairness configuration attribute for pools created with this configuration instance.

public void
setJmxEnabled(final boolean
The new setting of jmxEnabled for this configuration instance
jmxEnabled
)

Sets the value of the flag that determines if JMX will be enabled for pools created with this configuration instance.

public void
setJmxNameBase(final String
The new setting of jmxNameBase for this configuration instance
jmxNameBase
)

Sets the value of the JMX name base that will be used as part of the name assigned to JMX enabled pools created with this configuration instance.

public void
setJmxNamePrefix(final String
The new setting of jmxNamePrefix for this configuration instance
jmxNamePrefix
)

Sets the value of the JMX name prefix that will be used as part of the name assigned to JMX enabled pools created with this configuration instance.

public void
setLifo(final boolean
The new setting of lifo for this configuration instance
lifo
)

Sets the value for the lifo configuration attribute for pools created with this configuration instance.

public void
setMaxWait(final Duration
The new setting of maxWaitDuration for this configuration instance
maxWaitDuration
)

Sets the value for the maxWait configuration attribute for pools created with this configuration instance.

public void
setMaxWaitMillis(final long
The new setting of maxWaitMillis for this configuration instance
maxWaitMillis
)

Deprecated Use setMaxWait(Duration).
Sets the value for the maxWait configuration attribute for pools created with this configuration instance.
public void
setMinEvictableIdleDuration(final Duration
The new setting of minEvictableIdleTime for this configuration instance
minEvictableIdleTime
)

Sets the value for the minEvictableIdleTime configuration attribute for pools created with this configuration instance.

public void
setMinEvictableIdleTime(final Duration
The new setting of minEvictableIdleTime for this configuration instance
minEvictableIdleTime
)

Sets the value for the minEvictableIdleTime configuration attribute for pools created with this configuration instance.
public void
setMinEvictableIdleTimeMillis(final long
The new setting of minEvictableIdleTime for this configuration instance
minEvictableIdleTimeMillis
)

Sets the value for the minEvictableIdleTime configuration attribute for pools created with this configuration instance.
public void
setNumTestsPerEvictionRun(final int
The new setting of numTestsPerEvictionRun for this configuration instance
numTestsPerEvictionRun
)

Sets the value for the numTestsPerEvictionRun configuration attribute for pools created with this configuration instance.

public void
setSoftMinEvictableIdleDuration(final Duration
The new setting of softMinEvictableIdleTime for this configuration instance
softMinEvictableIdleTime
)

Sets the value for the softMinEvictableIdleTime configuration attribute for pools created with this configuration instance.

public void
setSoftMinEvictableIdleTime(final Duration
The new setting of softMinEvictableIdleTime for this configuration instance
softMinEvictableIdleTime
)

Sets the value for the softMinEvictableIdleTime configuration attribute for pools created with this configuration instance.
public void
setSoftMinEvictableIdleTimeMillis(final long
The new setting of softMinEvictableIdleTime for this configuration instance
softMinEvictableIdleTimeMillis
)

Sets the value for the softMinEvictableIdleTime configuration attribute for pools created with this configuration instance.
public void
setTestOnBorrow(final boolean
The new setting of testOnBorrow for this configuration instance
testOnBorrow
)

Sets the value for the testOnBorrow configuration attribute for pools created with this configuration instance.

public void
setTestOnCreate(final boolean
The new setting of testOnCreate for this configuration instance
testOnCreate
)

Sets the value for the testOnCreate configuration attribute for pools created with this configuration instance.

public void
setTestOnReturn(final boolean
The new setting of testOnReturn for this configuration instance
testOnReturn
)

Sets the value for the testOnReturn configuration attribute for pools created with this configuration instance.

public void
setTestWhileIdle(final boolean
The new setting of testWhileIdle for this configuration instance
testWhileIdle
)

Sets the value for the testWhileIdle configuration attribute for pools created with this configuration instance.

public void
setTimeBetweenEvictionRuns(final Duration
The new setting of timeBetweenEvictionRuns for this configuration instance
timeBetweenEvictionRuns
)

Sets the value for the timeBetweenEvictionRuns configuration attribute for pools created with this configuration instance.

public void
setTimeBetweenEvictionRunsMillis(final long
The new setting of timeBetweenEvictionRuns for this configuration instance
timeBetweenEvictionRunsMillis
)

Sets the value for the timeBetweenEvictionRuns configuration attribute for pools created with this configuration instance.
protected void
toStringAppendFields(final StringBuilder
Field names and values are appended to this object
builder
)

Overrides org.apache.commons.pool2.BaseObject.toStringAppendFields.

Used by sub-classes to include the fields defined by the sub-class in the toString() output.
Inherited from org.apache.commons.pool2.BaseObject:
toString