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

public Class GenericObjectPoolConfig<T>

extends BaseObjectPoolConfig<T>
Class Inheritance
Type Parameters
<T>
Type of element pooled.

A simple structure encapsulating the configuration for a GenericObjectPool.

This class is not thread-safe; it is only intended to be used to provide attributes used when creating a pool.

Since
2.0

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT_MAX_IDLE

The default value for the maxIdle configuration attribute.

public static final int
DEFAULT_MAX_TOTAL

The default value for the maxTotal configuration attribute.

public static final int
DEFAULT_MIN_IDLE

The default value for the minIdle configuration attribute.

private int
private int
private int
Inherited from org.apache.commons.pool2.impl.BaseObjectPoolConfig:
DEFAULT_BLOCK_WHEN_EXHAUSTEDDEFAULT_DURATION_BETWEEN_EVICTION_RUNSDEFAULT_EVICTION_POLICY_CLASS_NAMEDEFAULT_EVICTOR_SHUTDOWN_TIMEOUTDEFAULT_EVICTOR_SHUTDOWN_TIMEOUT_MILLISDEFAULT_FAIRNESSDEFAULT_JMX_ENABLEDEFAULT_JMX_NAME_BASEDEFAULT_JMX_NAME_PREFIXDEFAULT_LIFODEFAULT_MAX_WAITDEFAULT_MAX_WAIT_MILLISDEFAULT_MIN_EVICTABLE_IDLE_DURATIONDEFAULT_MIN_EVICTABLE_IDLE_TIMEDEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLISDEFAULT_NUM_TESTS_PER_EVICTION_RUNDEFAULT_SOFT_MIN_EVICTABLE_IDLE_DURATIONDEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIMEDEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLISDEFAULT_TEST_ON_BORROWDEFAULT_TEST_ON_CREATEDEFAULT_TEST_ON_RETURNDEFAULT_TEST_WHILE_IDLEDEFAULT_TIME_BETWEEN_EVICTION_RUNSDEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public GenericObjectPoolConfig<T>
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public int

Returns:

The current setting of maxIdle for this configuration instance
getMaxIdle
()

Get the value for the maxIdle configuration attribute for pools created with this configuration instance.

public int

Returns:

The current setting of maxTotal for this configuration instance
getMaxTotal
()

Get the value for the maxTotal configuration attribute for pools created with this configuration instance.

public int

Returns:

The current setting of minIdle for this configuration instance
getMinIdle
()

Get the value for the minIdle configuration attribute for pools created with this configuration instance.

public void
setMaxIdle(final int
The new setting of maxIdle for this configuration instance
maxIdle
)

Set the value for the maxIdle configuration attribute for pools created with this configuration instance.

public void
setMaxTotal(final int
The new setting of maxTotal for this configuration instance
maxTotal
)

Set the value for the maxTotal configuration attribute for pools created with this configuration instance.

public void
setMinIdle(final int
The new setting of minIdle for this configuration instance
minIdle
)

Set the value for the minIdle 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.impl.BaseObjectPoolConfig.toStringAppendFields.

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

Field Detail

DEFAULT_MAX_IDLEback to summary
public static final int DEFAULT_MAX_IDLE

The default value for the maxIdle configuration attribute.

See Also
GenericObjectPool#getMaxIdle()
DEFAULT_MAX_TOTALback to summary
public static final int DEFAULT_MAX_TOTAL

The default value for the maxTotal configuration attribute.

See Also
GenericObjectPool#getMaxTotal()
DEFAULT_MIN_IDLEback to summary
public static final int DEFAULT_MIN_IDLE

The default value for the minIdle configuration attribute.

See Also
GenericObjectPool#getMinIdle()
maxIdleback to summary
private int maxIdle
maxTotalback to summary
private int maxTotal
minIdleback to summary
private int minIdle

Constructor Detail

GenericObjectPoolConfigback to summary
public GenericObjectPoolConfig()

Method Detail

cloneback to summary
public GenericObjectPoolConfig<T> clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:GenericObjectPoolConfig<T>

a clone of this instance.

Annotations
@SuppressWarnings:unchecked
@Override
getMaxIdleback to summary
public int getMaxIdle()

Get the value for the maxIdle configuration attribute for pools created with this configuration instance.

Returns:int

The current setting of maxIdle for this configuration instance

See Also
GenericObjectPool#getMaxIdle()
getMaxTotalback to summary
public int getMaxTotal()

Get the value for the maxTotal configuration attribute for pools created with this configuration instance.

Returns:int

The current setting of maxTotal for this configuration instance

See Also
GenericObjectPool#getMaxTotal()
getMinIdleback to summary
public int getMinIdle()

Get the value for the minIdle configuration attribute for pools created with this configuration instance.

Returns:int

The current setting of minIdle for this configuration instance

See Also
GenericObjectPool#getMinIdle()
setMaxIdleback to summary
public void setMaxIdle(final int maxIdle)

Set the value for the maxIdle configuration attribute for pools created with this configuration instance.

Parameters
maxIdle:int

The new setting of maxIdle for this configuration instance

See Also
GenericObjectPool#setMaxIdle(int)
setMaxTotalback to summary
public void setMaxTotal(final int maxTotal)

Set the value for the maxTotal configuration attribute for pools created with this configuration instance.

Parameters
maxTotal:int

The new setting of maxTotal for this configuration instance

See Also
GenericObjectPool#setMaxTotal(int)
setMinIdleback to summary
public void setMinIdle(final int minIdle)

Set the value for the minIdle configuration attribute for pools created with this configuration instance.

Parameters
minIdle:int

The new setting of minIdle for this configuration instance

See Also
GenericObjectPool#setMinIdle(int)
toStringAppendFieldsback to summary
protected void toStringAppendFields(final StringBuilder builder)

Overrides org.apache.commons.pool2.impl.BaseObjectPoolConfig.toStringAppendFields.

Doc from org.apache.commons.pool2.BaseObject.toStringAppendFields.

Used by sub-classes to include the fields defined by the sub-class in the toString() output.

Parameters
builder:StringBuilder

Field names and values are appended to this object

Annotations
@Override