org.apache.ojb.broker.util.pooling
Class PoolConfiguration

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by org.apache.ojb.broker.util.pooling.PoolConfiguration
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>, AttributeContainer
Direct Known Subclasses:
ConnectionPoolDescriptor, PBPoolInfo

public class PoolConfiguration
extends Properties
implements Serializable, AttributeContainer

Encapsulates configuration properties for implementations using ObjectPool.

Version:
$Id: PoolConfiguration.java,v 1.1 2007-08-24 22:17:42 ewestfal Exp $
Author:
Armin Waibel
See Also:
Serialized Form

Field Summary
static boolean DEFAULT_LOG_ABANDONED
           
static int DEFAULT_MAX_ACTIVE
           
static int DEFAULT_MAX_IDLE
           
static long DEFAULT_MAX_WAIT
           
static long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
           
static int DEFAULT_MIN_IDLE
           
static int DEFAULT_NUM_TESTS_PER_EVICTION_RUN
           
static boolean DEFAULT_REMOVE_ABANDONED
           
static int DEFAULT_REMOVE_ABANDONED_TIMEOUT
           
static boolean DEFAULT_TEST_ON_BORROW
           
static boolean DEFAULT_TEST_ON_RETURN
           
static boolean DEFAULT_TEST_WHILE_IDLE
           
static long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
           
static byte DEFAULT_WHEN_EXHAUSTED_ACTION
           
static String LOG_ABANDONED
           
static String MAX_ACTIVE
           
static String MAX_IDLE
           
static String MAX_WAIT
           
static String MIN_EVICTABLE_IDLE_TIME_MILLIS
           
static String MIN_IDLE
           
static String NUM_TESTS_PER_EVICTION_RUN
           
static String REMOVE_ABANDONED
           
static String REMOVE_ABANDONED_TIMEOUT
           
static String TEST_ON_BORROW
           
static String TEST_ON_RETURN
           
static String TEST_WHILE_IDLE
           
static String TIME_BETWEEN_EVICTION_RUNS_MILLIS
           
static String VALIDATION_QUERY
           
static String WHEN_EXHAUSTED_ACTION
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PoolConfiguration()
           
PoolConfiguration(Properties properties)
           
 
Method Summary
 void addAttribute(String attributeName, String attributeValue)
          Store the specified attribute and it's value.
 org.apache.commons.dbcp.AbandonedConfig getAbandonedConfig()
           
 String getAttribute(String key)
          Get the value of an attribute
 String getAttribute(String attributeName, String defaultValue)
          Get the value of an attribute
 org.apache.commons.pool.impl.GenericKeyedObjectPool.Config getKeyedObjectPoolConfig()
          Returns an GenericKeyedObjectPool.Config object configurated with the properties extracted from the this instance.
 int getMaxActive()
           
 int getMaxIdle()
           
 long getMaxWait()
           
 long getMinEvictableIdleTimeMillis()
           
 int getMinIdle()
           
 int getNumTestsPerEvictionRun()
           
 org.apache.commons.pool.impl.GenericObjectPool.Config getObjectPoolConfig()
          Returns an GenericObjectPool.Config object configurated with the properties extracted from the this instance.
 int getRemoveAbandonedTimeout()
           
 long getTimeBetweenEvictionRunsMillis()
           
 String getValidationQuery()
           
 byte getWhenExhaustedAction()
           
 boolean isLogAbandoned()
           
 boolean isRemoveAbandoned()
           
 boolean isTestOnBorrow()
           
 boolean isTestOnReturn()
           
 boolean isTestWhileIdle()
           
 void setLogAbandoned(boolean logAbandoned)
           
 void setMaxActive(int maxActive)
           
 void setMaxIdle(int maxIdle)
           
 void setMaxWait(long maxWait)
           
 void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
           
 void setMinIdle(int minIdle)
           
 void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
           
 void setRemoveAbandoned(boolean removeAbandoned)
           
 void setRemoveAbandonedTimeout(int removeAbandonedTimeout)
           
 void setTestOnBorrow(boolean testOnBorrow)
           
 void setTestOnReturn(boolean testOnReturn)
           
 void setTestWhileIdle(boolean testWhileIdle)
           
 void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
           
 void setValidationQuery(String validationQuery)
           
 void setWhenExhaustedAction(byte whenExhaustedAction)
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_ACTIVE

public static final String MAX_ACTIVE
See Also:
Constant Field Values

MAX_IDLE

public static final String MAX_IDLE
See Also:
Constant Field Values

MIN_IDLE

public static final String MIN_IDLE
See Also:
Constant Field Values

MAX_WAIT

public static final String MAX_WAIT
See Also:
Constant Field Values

WHEN_EXHAUSTED_ACTION

public static final String WHEN_EXHAUSTED_ACTION
See Also:
Constant Field Values

TEST_ON_BORROW

public static final String TEST_ON_BORROW
See Also:
Constant Field Values

TEST_ON_RETURN

public static final String TEST_ON_RETURN
See Also:
Constant Field Values

TEST_WHILE_IDLE

public static final String TEST_WHILE_IDLE
See Also:
Constant Field Values

TIME_BETWEEN_EVICTION_RUNS_MILLIS

public static final String TIME_BETWEEN_EVICTION_RUNS_MILLIS
See Also:
Constant Field Values

NUM_TESTS_PER_EVICTION_RUN

public static final String NUM_TESTS_PER_EVICTION_RUN
See Also:
Constant Field Values

MIN_EVICTABLE_IDLE_TIME_MILLIS

public static final String MIN_EVICTABLE_IDLE_TIME_MILLIS
See Also:
Constant Field Values

LOG_ABANDONED

public static final String LOG_ABANDONED
See Also:
Constant Field Values

REMOVE_ABANDONED

public static final String REMOVE_ABANDONED
See Also:
Constant Field Values

REMOVE_ABANDONED_TIMEOUT

public static final String REMOVE_ABANDONED_TIMEOUT
See Also:
Constant Field Values

VALIDATION_QUERY

public static final String VALIDATION_QUERY
See Also:
Constant Field Values

DEFAULT_MAX_ACTIVE

public static final int DEFAULT_MAX_ACTIVE
See Also:
Constant Field Values

DEFAULT_MAX_IDLE

public static final int DEFAULT_MAX_IDLE
See Also:
Constant Field Values

DEFAULT_MIN_IDLE

public static final int DEFAULT_MIN_IDLE
See Also:
Constant Field Values

DEFAULT_MAX_WAIT

public static final long DEFAULT_MAX_WAIT
See Also:
Constant Field Values

DEFAULT_WHEN_EXHAUSTED_ACTION

public static final byte DEFAULT_WHEN_EXHAUSTED_ACTION
See Also:
Constant Field Values

DEFAULT_TEST_ON_BORROW

public static final boolean DEFAULT_TEST_ON_BORROW
See Also:
Constant Field Values

DEFAULT_TEST_ON_RETURN

public static final boolean DEFAULT_TEST_ON_RETURN
See Also:
Constant Field Values

DEFAULT_TEST_WHILE_IDLE

public static final boolean DEFAULT_TEST_WHILE_IDLE
See Also:
Constant Field Values

DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS

public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
See Also:
Constant Field Values

DEFAULT_NUM_TESTS_PER_EVICTION_RUN

public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN
See Also:
Constant Field Values

DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS

public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
See Also:
Constant Field Values

DEFAULT_LOG_ABANDONED

public static final boolean DEFAULT_LOG_ABANDONED
See Also:
Constant Field Values

DEFAULT_REMOVE_ABANDONED

public static final boolean DEFAULT_REMOVE_ABANDONED
See Also:
Constant Field Values

DEFAULT_REMOVE_ABANDONED_TIMEOUT

public static final int DEFAULT_REMOVE_ABANDONED_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

PoolConfiguration

public PoolConfiguration()

PoolConfiguration

public PoolConfiguration(Properties properties)
Method Detail

getObjectPoolConfig

public org.apache.commons.pool.impl.GenericObjectPool.Config getObjectPoolConfig()
Returns an GenericObjectPool.Config object configurated with the properties extracted from the this instance. Use this to configurate a pool implementation using GenericObjectPool.


getKeyedObjectPoolConfig

public org.apache.commons.pool.impl.GenericKeyedObjectPool.Config getKeyedObjectPoolConfig()
Returns an GenericKeyedObjectPool.Config object configurated with the properties extracted from the this instance. Use this to configurate a pool implementation using GenericKeyedObjectPool.


getAbandonedConfig

public org.apache.commons.dbcp.AbandonedConfig getAbandonedConfig()

addAttribute

public void addAttribute(String attributeName,
                         String attributeValue)
Description copied from interface: AttributeContainer
Store the specified attribute and it's value.

Specified by:
addAttribute in interface AttributeContainer
Parameters:
attributeName - the name of the attribute to retrieve
attributeValue - the attribute's value

getAttribute

public String getAttribute(String key)
Description copied from interface: AttributeContainer
Get the value of an attribute

Specified by:
getAttribute in interface AttributeContainer
Parameters:
key - the attribute to retrieve
Returns:
the attribute value

getAttribute

public String getAttribute(String attributeName,
                           String defaultValue)
Description copied from interface: AttributeContainer
Get the value of an attribute

Specified by:
getAttribute in interface AttributeContainer
Parameters:
attributeName - the attribute to retrieve
defaultValue - the value to return if the attribute is not present
Returns:
the attribute value

isLogAbandoned

public boolean isLogAbandoned()

setLogAbandoned

public void setLogAbandoned(boolean logAbandoned)

isRemoveAbandoned

public boolean isRemoveAbandoned()

setRemoveAbandoned

public void setRemoveAbandoned(boolean removeAbandoned)

getRemoveAbandonedTimeout

public int getRemoveAbandonedTimeout()

setRemoveAbandonedTimeout

public void setRemoveAbandonedTimeout(int removeAbandonedTimeout)

getValidationQuery

public String getValidationQuery()

setValidationQuery

public void setValidationQuery(String validationQuery)

getMaxActive

public int getMaxActive()

setMaxActive

public void setMaxActive(int maxActive)

getMaxIdle

public int getMaxIdle()

setMaxIdle

public void setMaxIdle(int maxIdle)

getMinIdle

public int getMinIdle()

setMinIdle

public void setMinIdle(int minIdle)

getMaxWait

public long getMaxWait()

setMaxWait

public void setMaxWait(long maxWait)

getWhenExhaustedAction

public byte getWhenExhaustedAction()

setWhenExhaustedAction

public void setWhenExhaustedAction(byte whenExhaustedAction)

isTestOnBorrow

public boolean isTestOnBorrow()

setTestOnBorrow

public void setTestOnBorrow(boolean testOnBorrow)

isTestOnReturn

public boolean isTestOnReturn()

setTestOnReturn

public void setTestOnReturn(boolean testOnReturn)

isTestWhileIdle

public boolean isTestWhileIdle()

setTestWhileIdle

public void setTestWhileIdle(boolean testWhileIdle)

getMinEvictableIdleTimeMillis

public long getMinEvictableIdleTimeMillis()

setMinEvictableIdleTimeMillis

public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)

getTimeBetweenEvictionRunsMillis

public long getTimeBetweenEvictionRunsMillis()

setTimeBetweenEvictionRunsMillis

public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)

getNumTestsPerEvictionRun

public int getNumTestsPerEvictionRun()

setNumTestsPerEvictionRun

public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.