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

public Class GenericKeyedObjectPoolConfig<T>

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

A simple structure encapsulating the configuration for a GenericKeyedObjectPool.

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_PER_KEY

The default value for the maxIdlePerKey configuration attribute: .

public static final int
DEFAULT_MAX_TOTAL

The default value for the maxTotal configuration attribute: .

public static final int
DEFAULT_MAX_TOTAL_PER_KEY

The default value for the maxTotalPerKey configuration attribute: .

public static final int
DEFAULT_MIN_IDLE_PER_KEY

The default value for the minIdlePerKey configuration attribute: .

public static final boolean
DEFAULT_REUSE_CAPACITY_ON_MAINTENANCE

The default value for the reuseCapacityOnMaintenance configuration attribute: .

public static final boolean
DEFAULT_REUSE_CAPACITY_ON_RETURN

The default value for the reuseCapacityOnReturn configuration attribute: .

private int
private int
private int
private int
private boolean
private boolean
Inherited from org.apache.commons.pool2.impl.BaseObjectPoolConfig:
DEFAULT_BLOCK_WHEN_EXHAUSTEDDEFAULT_COLLECT_DETAILED_STATISTICSDEFAULT_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
GenericKeyedObjectPoolConfig()

Constructs a new configuration with default settings.

Method Summary

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

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public int

Returns:

The current setting of maxIdlePerKey for this configuration instance
getMaxIdlePerKey
()

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

public int

Returns:

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

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

public int

Returns:

The current setting of maxTotalPerKey for this configuration instance
getMaxTotalPerKey
()

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

public int

Returns:

The current setting of minIdlePerKey for this configuration instance
getMinIdlePerKey
()

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

public boolean

Returns:

The current setting of reuseCapacityOnMaintenance for this configuration instance
getReuseCapacityOnMaintenance
()

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

public boolean

Returns:

The current setting of reuseCapacityOnReturn for this configuration instance
getReuseCapacityOnReturn
()

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

public void
setMaxIdlePerKey(final int
The new setting of maxIdlePerKey for this configuration instance
maxIdlePerKey
)

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

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

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

public void
setMaxTotalPerKey(final int
The new setting of maxTotalPerKey for this configuration instance
maxTotalPerKey
)

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

public void
setMinIdlePerKey(final int
The new setting of minIdlePerKey for this configuration instance
minIdlePerKey
)

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

public void
setReuseCapacityOnMaintenance(final boolean
The new setting of reuseCapacityOnMaintenance for this configuration instance
reuseCapacityOnMaintenance
)

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

public void
setReuseCapacityOnReturn(final boolean
The new setting of reuseCapacityOnReturn for this configuration instance
reuseCapacityOnReturn
)

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

protected void
toStringAppendFields(final StringBuilder 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:
getBlockWhenExhaustedgetCollectDetailedStatisticsgetDurationBetweenEvictionRunsgetEvictionPolicygetEvictionPolicyClassNamegetEvictorShutdownTimeoutgetEvictorShutdownTimeoutDurationgetEvictorShutdownTimeoutMillisgetFairnessgetJmxEnabledgetJmxNameBasegetJmxNamePrefixgetLifogetMaxWaitDurationgetMaxWaitMillisgetMinEvictableIdleDurationgetMinEvictableIdleTimegetMinEvictableIdleTimeMillisgetNumTestsPerEvictionRungetSoftMinEvictableIdleDurationgetSoftMinEvictableIdleTimegetSoftMinEvictableIdleTimeMillisgetTestOnBorrowgetTestOnCreategetTestOnReturngetTestWhileIdlegetTimeBetweenEvictionRunsgetTimeBetweenEvictionRunsMillissetBlockWhenExhaustedsetCollectDetailedStatisticssetEvictionPolicysetEvictionPolicyClassNamesetEvictorShutdownTimeoutsetEvictorShutdownTimeoutMillissetEvictorShutdownTimeoutMillissetFairnesssetJmxEnabledsetJmxNameBasesetJmxNamePrefixsetLifosetMaxWaitsetMaxWaitMillissetMinEvictableIdleDurationsetMinEvictableIdleTimesetMinEvictableIdleTimeMillissetNumTestsPerEvictionRunsetSoftMinEvictableIdleDurationsetSoftMinEvictableIdleTimesetSoftMinEvictableIdleTimeMillissetTestOnBorrowsetTestOnCreatesetTestOnReturnsetTestWhileIdlesetTimeBetweenEvictionRunssetTimeBetweenEvictionRunsMillis

Field Detail

DEFAULT_MAX_IDLE_PER_KEYback to summary
public static final int DEFAULT_MAX_IDLE_PER_KEY

The default value for the maxIdlePerKey configuration attribute: .

See Also
GenericKeyedObjectPool#getMaxIdlePerKey()
DEFAULT_MAX_TOTALback to summary
public static final int DEFAULT_MAX_TOTAL

The default value for the maxTotal configuration attribute: .

See Also
GenericKeyedObjectPool#getMaxTotal()
DEFAULT_MAX_TOTAL_PER_KEYback to summary
public static final int DEFAULT_MAX_TOTAL_PER_KEY

The default value for the maxTotalPerKey configuration attribute: .

See Also
GenericKeyedObjectPool#getMaxTotalPerKey()
DEFAULT_MIN_IDLE_PER_KEYback to summary
public static final int DEFAULT_MIN_IDLE_PER_KEY

The default value for the minIdlePerKey configuration attribute: .

See Also
GenericKeyedObjectPool#getMinIdlePerKey()
DEFAULT_REUSE_CAPACITY_ON_MAINTENANCEback to summary
public static final boolean DEFAULT_REUSE_CAPACITY_ON_MAINTENANCE

The default value for the reuseCapacityOnMaintenance configuration attribute: .

Since
2.13.0
See Also
GenericKeyedObjectPool#getReuseCapacityOnMaintenance()
DEFAULT_REUSE_CAPACITY_ON_RETURNback to summary
public static final boolean DEFAULT_REUSE_CAPACITY_ON_RETURN

The default value for the reuseCapacityOnReturn configuration attribute: .

Since
2.13.0
See Also
GenericKeyedObjectPool#getReuseCapacityOnReturn()
maxIdlePerKeyback to summary
private int maxIdlePerKey
maxTotalback to summary
private int maxTotal
maxTotalPerKeyback to summary
private int maxTotalPerKey
minIdlePerKeyback to summary
private int minIdlePerKey
reuseCapacityOnMaintenanceback to summary
private boolean reuseCapacityOnMaintenance
reuseCapacityOnReturnback to summary
private boolean reuseCapacityOnReturn

Constructor Detail

GenericKeyedObjectPoolConfigback to summary
public GenericKeyedObjectPoolConfig()

Constructs a new configuration with default settings.

Method Detail

cloneback to summary
public GenericKeyedObjectPoolConfig<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.

Annotations
@SuppressWarnings:unchecked
@Override
getMaxIdlePerKeyback to summary
public int getMaxIdlePerKey()

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

Returns:int

The current setting of maxIdlePerKey for this configuration instance

See Also
GenericKeyedObjectPool#getMaxIdlePerKey()
getMaxTotalback to summary
public int getMaxTotal()

Gets 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
GenericKeyedObjectPool#getMaxTotal()
getMaxTotalPerKeyback to summary
public int getMaxTotalPerKey()

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

Returns:int

The current setting of maxTotalPerKey for this configuration instance

See Also
GenericKeyedObjectPool#getMaxTotalPerKey()
getMinIdlePerKeyback to summary
public int getMinIdlePerKey()

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

Returns:int

The current setting of minIdlePerKey for this configuration instance

See Also
GenericKeyedObjectPool#getMinIdlePerKey()
getReuseCapacityOnMaintenanceback to summary
public boolean getReuseCapacityOnMaintenance()

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

Returns:boolean

The current setting of reuseCapacityOnMaintenance for this configuration instance

Since
2.13.0
See Also
GenericKeyedObjectPool#getReuseCapacityOnMaintenance()
getReuseCapacityOnReturnback to summary
public boolean getReuseCapacityOnReturn()

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

Returns:boolean

The current setting of reuseCapacityOnReturn for this configuration instance

Since
2.13.0
See Also
GenericKeyedObjectPool#getReuseCapacityOnReturn()
setMaxIdlePerKeyback to summary
public void setMaxIdlePerKey(final int maxIdlePerKey)

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

Parameters
maxIdlePerKey:int

The new setting of maxIdlePerKey for this configuration instance

See Also
GenericKeyedObjectPool#setMaxIdlePerKey(int)
setMaxTotalback to summary
public void setMaxTotal(final int maxTotal)

Sets 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
GenericKeyedObjectPool#setMaxTotal(int)
setMaxTotalPerKeyback to summary
public void setMaxTotalPerKey(final int maxTotalPerKey)

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

Parameters
maxTotalPerKey:int

The new setting of maxTotalPerKey for this configuration instance

See Also
GenericKeyedObjectPool#setMaxTotalPerKey(int)
setMinIdlePerKeyback to summary
public void setMinIdlePerKey(final int minIdlePerKey)

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

Parameters
minIdlePerKey:int

The new setting of minIdlePerKey for this configuration instance

See Also
GenericKeyedObjectPool#setMinIdlePerKey(int)
setReuseCapacityOnMaintenanceback to summary
public void setReuseCapacityOnMaintenance(final boolean reuseCapacityOnMaintenance)

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

Parameters
reuseCapacityOnMaintenance:boolean

The new setting of reuseCapacityOnMaintenance for this configuration instance

Since
2.13.0
See Also
GenericKeyedObjectPool#setReuseCapacityOnMaintenance(boolean)
setReuseCapacityOnReturnback to summary
public void setReuseCapacityOnReturn(final boolean reuseCapacityOnReturn)

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

Parameters
reuseCapacityOnReturn:boolean

The new setting of reuseCapacityOnReturn for this configuration instance

Since
2.13.0
See Also
GenericKeyedObjectPool#setReuseCapacityOnReturn(boolean)
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.

Annotations
@Override