org.apache.commons.pool2.impl
Class BaseObjectPoolConfig

java.lang.Object
  extended by org.apache.commons.pool2.impl.BaseObjectPoolConfig
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
GenericKeyedObjectPoolConfig, GenericObjectPoolConfig

public abstract class BaseObjectPoolConfig
extends Object
implements Cloneable

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
Version:
$Revision: $

Field Summary
static boolean DEFAULT_BLOCK_WHEN_EXHAUSTED
          The default value for the blockWhenExhausted configuration attribute.
static String DEFAULT_EVICTION_POLICY_CLASS_NAME
          The default value for the evictionPolicyClassName configuration attribute.
static boolean DEFAULT_JMX_ENABLE
          The default value for enabling JMX for pools created with a configuration instance.
static String DEFAULT_JMX_NAME_PREFIX
          The default value for the prefix used to name JMX enabled pools created with a configuration instance.
static boolean DEFAULT_LIFO
          The default value for the lifo configuration attribute.
static long DEFAULT_MAX_WAIT_MILLIS
          The default value for the maxWait configuration attribute.
static long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
          The default value for the minEvictableIdleTimeMillis configuration attribute.
static int DEFAULT_NUM_TESTS_PER_EVICTION_RUN
          The default value for the numTestsPerEvictionRun configuration attribute.
static long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS
          The default value for the softMinEvictableIdleTimeMillis configuration attribute.
static boolean DEFAULT_TEST_ON_BORROW
          The default value for the testOnBorrow configuration attribute.
static boolean DEFAULT_TEST_ON_RETURN
          The default value for the testOnReturn configuration attribute.
static boolean DEFAULT_TEST_WHILE_IDLE
          The default value for the testWhileIdle configuration attribute.
static long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
          The default value for the timeBetweenEvictionRunsMillis configuration attribute.
 
Constructor Summary
BaseObjectPoolConfig()
           
 
Method Summary
 boolean getBlockWhenExhausted()
          Get the value for the blockWhenExhausted configuration attribute for pools created with this configuration instance.
 String getEvictionPolicyClassName()
          Get the value for the evictionPolicyClassName configuration attribute for pools created with this configuration instance.
 boolean getJmxEnabled()
          Gets the value of the flag that determines if JMX will be enabled for pools created with this configuration instance.
 String 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.
 boolean getLifo()
          Get the value for the lifo configuration attribute for pools created with this configuration instance.
 long getMaxWaitMillis()
          Get the value for the maxWait configuration attribute for pools created with this configuration instance.
 long getMinEvictableIdleTimeMillis()
          Get the value for the minEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.
 int getNumTestsPerEvictionRun()
          Get the value for the numTestsPerEvictionRun configuration attribute for pools created with this configuration instance.
 long getSoftMinEvictableIdleTimeMillis()
          Get the value for the softMinEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.
 boolean getTestOnBorrow()
          Get the value for the testOnBorrow configuration attribute for pools created with this configuration instance.
 boolean getTestOnReturn()
          Get the value for the testOnReturn configuration attribute for pools created with this configuration instance.
 boolean getTestWhileIdle()
          Get the value for the testWhileIdle configuration attribute for pools created with this configuration instance.
 long getTimeBetweenEvictionRunsMillis()
          Get the value for the timeBetweenEvictionRunsMillis configuration attribute for pools created with this configuration instance.
 void setBlockWhenExhausted(boolean blockWhenExhausted)
          Set the value for the blockWhenExhausted configuration attribute for pools created with this configuration instance.
 void setEvictionPolicyClassName(String evictionPolicyClassName)
          Set the value for the evictionPolicyClassName configuration attribute for pools created with this configuration instance.
 void setJmxEnabled(boolean jmxEnabled)
          Sets the value of the flag that determines if JMX will be enabled for pools created with this configuration instance.
 void setJmxNamePrefix(String 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.
 void setLifo(boolean lifo)
          Set the value for the lifo configuration attribute for pools created with this configuration instance.
 void setMaxWaitMillis(long maxWaitMillis)
          Set the value for the maxWait configuration attribute for pools created with this configuration instance.
 void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
          Set the value for the minEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.
 void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
          Set the value for the numTestsPerEvictionRun configuration attribute for pools created with this configuration instance.
 void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
          Set the value for the softMinEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.
 void setTestOnBorrow(boolean testOnBorrow)
          Set the value for the testOnBorrow configuration attribute for pools created with this configuration instance.
 void setTestOnReturn(boolean testOnReturn)
          Set the value for the testOnReturn configuration attribute for pools created with this configuration instance.
 void setTestWhileIdle(boolean testWhileIdle)
          Set the value for the testWhileIdle configuration attribute for pools created with this configuration instance.
 void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
          Set the value for the timeBetweenEvictionRunsMillis configuration attribute for pools created with this configuration instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LIFO

public static final boolean DEFAULT_LIFO
The default value for the lifo configuration attribute.

See Also:
BaseGenericObjectPool.getLifo(), BaseGenericObjectPool.getLifo(), Constant Field Values

DEFAULT_MAX_WAIT_MILLIS

public static final long DEFAULT_MAX_WAIT_MILLIS
The default value for the maxWait configuration attribute.

See Also:
BaseGenericObjectPool.getMaxWaitMillis(), BaseGenericObjectPool.getMaxWaitMillis(), Constant Field Values

DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS

public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
The default value for the minEvictableIdleTimeMillis configuration attribute.

See Also:
BaseGenericObjectPool.getMinEvictableIdleTimeMillis(), BaseGenericObjectPool.getMinEvictableIdleTimeMillis(), Constant Field Values

DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS

public static final long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS
The default value for the softMinEvictableIdleTimeMillis configuration attribute.

See Also:
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis(), BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis(), Constant Field Values

DEFAULT_NUM_TESTS_PER_EVICTION_RUN

public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN
The default value for the numTestsPerEvictionRun configuration attribute.

See Also:
BaseGenericObjectPool.getNumTestsPerEvictionRun(), BaseGenericObjectPool.getNumTestsPerEvictionRun(), Constant Field Values

DEFAULT_TEST_ON_BORROW

public static final boolean DEFAULT_TEST_ON_BORROW
The default value for the testOnBorrow configuration attribute.

See Also:
BaseGenericObjectPool.getTestOnBorrow(), BaseGenericObjectPool.getTestOnBorrow(), Constant Field Values

DEFAULT_TEST_ON_RETURN

public static final boolean DEFAULT_TEST_ON_RETURN
The default value for the testOnReturn configuration attribute.

See Also:
BaseGenericObjectPool.getTestOnReturn(), BaseGenericObjectPool.getTestOnReturn(), Constant Field Values

DEFAULT_TEST_WHILE_IDLE

public static final boolean DEFAULT_TEST_WHILE_IDLE
The default value for the testWhileIdle configuration attribute.

See Also:
BaseGenericObjectPool.getTestWhileIdle(), BaseGenericObjectPool.getTestWhileIdle(), Constant Field Values

DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS

public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
The default value for the timeBetweenEvictionRunsMillis configuration attribute.

See Also:
BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis(), BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis(), Constant Field Values

DEFAULT_BLOCK_WHEN_EXHAUSTED

public static final boolean DEFAULT_BLOCK_WHEN_EXHAUSTED
The default value for the blockWhenExhausted configuration attribute.

See Also:
BaseGenericObjectPool.getBlockWhenExhausted(), BaseGenericObjectPool.getBlockWhenExhausted(), Constant Field Values

DEFAULT_JMX_ENABLE

public static final boolean DEFAULT_JMX_ENABLE
The default value for enabling JMX for pools created with a configuration instance.

See Also:
Constant Field Values

DEFAULT_JMX_NAME_PREFIX

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.

See Also:
BaseGenericObjectPool.getJmxName(), BaseGenericObjectPool.getJmxName(), Constant Field Values

DEFAULT_EVICTION_POLICY_CLASS_NAME

public static final String DEFAULT_EVICTION_POLICY_CLASS_NAME
The default value for the evictionPolicyClassName configuration attribute.

See Also:
BaseGenericObjectPool.getEvictionPolicyClassName(), BaseGenericObjectPool.getEvictionPolicyClassName(), Constant Field Values
Constructor Detail

BaseObjectPoolConfig

public BaseObjectPoolConfig()
Method Detail

getLifo

public boolean getLifo()
Get the value for the lifo configuration attribute for pools created with this configuration instance.

Returns:
The current setting of lifo for this configuration instance
See Also:
BaseGenericObjectPool.getLifo(), BaseGenericObjectPool.getLifo()

setLifo

public void setLifo(boolean lifo)
Set the value for the lifo configuration attribute for pools created with this configuration instance.

Parameters:
lifo - The new setting of lifo for this configuration instance
See Also:
BaseGenericObjectPool.getLifo(), BaseGenericObjectPool.getLifo()

getMaxWaitMillis

public long getMaxWaitMillis()
Get the value for the maxWait configuration attribute for pools created with this configuration instance.

Returns:
The current setting of maxWait for this configuration instance
See Also:
BaseGenericObjectPool.getMaxWaitMillis(), BaseGenericObjectPool.getMaxWaitMillis()

setMaxWaitMillis

public void setMaxWaitMillis(long maxWaitMillis)
Set the value for the maxWait configuration attribute for pools created with this configuration instance.

Parameters:
maxWaitMillis - The new setting of maxWaitMillis for this configuration instance
See Also:
BaseGenericObjectPool.getMaxWaitMillis(), BaseGenericObjectPool.getMaxWaitMillis()

getMinEvictableIdleTimeMillis

public long getMinEvictableIdleTimeMillis()
Get the value for the minEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.

Returns:
The current setting of minEvictableIdleTimeMillis for this configuration instance
See Also:
BaseGenericObjectPool.getMinEvictableIdleTimeMillis(), BaseGenericObjectPool.getMinEvictableIdleTimeMillis()

setMinEvictableIdleTimeMillis

public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Set the value for the minEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.

Parameters:
minEvictableIdleTimeMillis - The new setting of minEvictableIdleTimeMillis for this configuration instance
See Also:
BaseGenericObjectPool.getMinEvictableIdleTimeMillis(), BaseGenericObjectPool.getMinEvictableIdleTimeMillis()

getSoftMinEvictableIdleTimeMillis

public long getSoftMinEvictableIdleTimeMillis()
Get the value for the softMinEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.

Returns:
The current setting of softMinEvictableIdleTimeMillis for this configuration instance
See Also:
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis(), BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()

setSoftMinEvictableIdleTimeMillis

public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
Set the value for the softMinEvictableIdleTimeMillis configuration attribute for pools created with this configuration instance.

Parameters:
softMinEvictableIdleTimeMillis - The new setting of softMinEvictableIdleTimeMillis for this configuration instance
See Also:
BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis(), BaseGenericObjectPool.getSoftMinEvictableIdleTimeMillis()

getNumTestsPerEvictionRun

public int getNumTestsPerEvictionRun()
Get the value for the numTestsPerEvictionRun configuration attribute for pools created with this configuration instance.

Returns:
The current setting of numTestsPerEvictionRun for this configuration instance
See Also:
BaseGenericObjectPool.getNumTestsPerEvictionRun(), BaseGenericObjectPool.getNumTestsPerEvictionRun()

setNumTestsPerEvictionRun

public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
Set the value for the numTestsPerEvictionRun configuration attribute for pools created with this configuration instance.

Parameters:
numTestsPerEvictionRun - The new setting of numTestsPerEvictionRun for this configuration instance
See Also:
BaseGenericObjectPool.getNumTestsPerEvictionRun(), BaseGenericObjectPool.getNumTestsPerEvictionRun()

getTestOnBorrow

public boolean getTestOnBorrow()
Get the value for the testOnBorrow configuration attribute for pools created with this configuration instance.

Returns:
The current setting of testOnBorrow for this configuration instance
See Also:
BaseGenericObjectPool.getTestOnBorrow(), BaseGenericObjectPool.getTestOnBorrow()

setTestOnBorrow

public void setTestOnBorrow(boolean testOnBorrow)
Set the value for the testOnBorrow configuration attribute for pools created with this configuration instance.

Parameters:
testOnBorrow - The new setting of testOnBorrow for this configuration instance
See Also:
BaseGenericObjectPool.getTestOnBorrow(), BaseGenericObjectPool.getTestOnBorrow()

getTestOnReturn

public boolean getTestOnReturn()
Get the value for the testOnReturn configuration attribute for pools created with this configuration instance.

Returns:
The current setting of testOnReturn for this configuration instance
See Also:
BaseGenericObjectPool.getTestOnReturn(), BaseGenericObjectPool.getTestOnReturn()

setTestOnReturn

public void setTestOnReturn(boolean testOnReturn)
Set the value for the testOnReturn configuration attribute for pools created with this configuration instance.

Parameters:
testOnReturn - The new setting of testOnReturn for this configuration instance
See Also:
BaseGenericObjectPool.getTestOnReturn(), BaseGenericObjectPool.getTestOnReturn()

getTestWhileIdle

public boolean getTestWhileIdle()
Get the value for the testWhileIdle configuration attribute for pools created with this configuration instance.

Returns:
The current setting of testWhileIdle for this configuration instance
See Also:
BaseGenericObjectPool.getTestWhileIdle(), BaseGenericObjectPool.getTestWhileIdle()

setTestWhileIdle

public void setTestWhileIdle(boolean testWhileIdle)
Set the value for the testWhileIdle configuration attribute for pools created with this configuration instance.

Parameters:
testWhileIdle - The new setting of testWhileIdle for this configuration instance
See Also:
BaseGenericObjectPool.getTestWhileIdle(), BaseGenericObjectPool.getTestWhileIdle()

getTimeBetweenEvictionRunsMillis

public long getTimeBetweenEvictionRunsMillis()
Get the value for the timeBetweenEvictionRunsMillis configuration attribute for pools created with this configuration instance.

Returns:
The current setting of timeBetweenEvictionRunsMillis for this configuration instance
See Also:
BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis(), BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis()

setTimeBetweenEvictionRunsMillis

public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Set the value for the timeBetweenEvictionRunsMillis configuration attribute for pools created with this configuration instance.

Parameters:
timeBetweenEvictionRunsMillis - The new setting of timeBetweenEvictionRunsMillis for this configuration instance
See Also:
BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis(), BaseGenericObjectPool.getTimeBetweenEvictionRunsMillis()

getEvictionPolicyClassName

public String getEvictionPolicyClassName()
Get the value for the evictionPolicyClassName configuration attribute for pools created with this configuration instance.

Returns:
The current setting of evictionPolicyClassName for this configuration instance
See Also:
BaseGenericObjectPool.getEvictionPolicyClassName(), BaseGenericObjectPool.getEvictionPolicyClassName()

setEvictionPolicyClassName

public void setEvictionPolicyClassName(String evictionPolicyClassName)
Set the value for the evictionPolicyClassName configuration attribute for pools created with this configuration instance.

Parameters:
evictionPolicyClassName - The new setting of evictionPolicyClassName for this configuration instance
See Also:
BaseGenericObjectPool.getEvictionPolicyClassName(), BaseGenericObjectPool.getEvictionPolicyClassName()

getBlockWhenExhausted

public boolean getBlockWhenExhausted()
Get the value for the blockWhenExhausted configuration attribute for pools created with this configuration instance.

Returns:
The current setting of blockWhenExhausted for this configuration instance
See Also:
BaseGenericObjectPool.getBlockWhenExhausted(), BaseGenericObjectPool.getBlockWhenExhausted()

setBlockWhenExhausted

public void setBlockWhenExhausted(boolean blockWhenExhausted)
Set the value for the blockWhenExhausted configuration attribute for pools created with this configuration instance.

Parameters:
blockWhenExhausted - The new setting of blockWhenExhausted for this configuration instance
See Also:
BaseGenericObjectPool.getBlockWhenExhausted(), BaseGenericObjectPool.getBlockWhenExhausted()

getJmxEnabled

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

Returns:
The current setting of jmxEnabled for this configuration instance

setJmxEnabled

public void setJmxEnabled(boolean jmxEnabled)
Sets the value of the flag that determines if JMX will be enabled for pools created with this configuration instance.

Parameters:
jmxEnabled - The new setting of jmxEnabled for this configuration instance

getJmxNamePrefix

public String 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.

Returns:
The current setting of jmxNamePrefix for this configuration instance

setJmxNamePrefix

public void setJmxNamePrefix(String 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.

Parameters:
jmxNamePrefix - The new setting of jmxNamePrefix for this configuration instance


Copyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.