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.

private int
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
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
()

Get 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
()

Get 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
()

Get 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
()

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

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

Set 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
)

Set 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
)

Set 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
)

Set the value for the minIdlePerKey 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_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()
maxIdlePerKeyback to summary
private int maxIdlePerKey
maxTotalback to summary
private int maxTotal
maxTotalPerKeyback to summary
private int maxTotalPerKey
minIdlePerKeyback to summary
private int minIdlePerKey

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.

Returns:GenericKeyedObjectPoolConfig<T>

a clone of this instance.

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

Get 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()

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

Get 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()

Get 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()
setMaxIdlePerKeyback to summary
public void setMaxIdlePerKey(final int maxIdlePerKey)

Set 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)

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

Set 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)

Set 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)
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