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

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.apache.ojb.broker.util.pooling.PoolConfiguration
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Direct Known Subclasses:
ConnectionPoolDescriptor, PBPoolInfo

public class PoolConfiguration
extends java.util.Properties
implements java.io.Serializable

Encapsulates configuration properties for implementations using ObjectPool.

Version:
$Id: PoolConfiguration.java,v 1.8 2004/02/11 19:35:25 arminw Exp $
Author:
Armin Waibel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
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_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 java.lang.String EMPTY
           
static java.lang.String LOG_ABANDONED
           
static java.lang.String MAX_ACTIVE
           
static java.lang.String MAX_IDLE
           
static java.lang.String MAX_WAIT
           
static java.lang.String MIN_EVICTABLE_IDLE_TIME_MILLIS
           
static java.lang.String NUM_TESTS_PER_EVICTION_RUN
           
static java.lang.String REMOVE_ABANDONED
           
static java.lang.String REMOVE_ABANDONED_TIMEOUT
           
static java.lang.String TEST_ON_BORROW
           
static java.lang.String TEST_ON_RETURN
           
static java.lang.String TEST_WHILE_IDLE
           
static java.lang.String TIME_BETWEEN_EVICTION_RUNS_MILLIS
           
static java.lang.String VALIDATION_QUERY
           
static java.lang.String WHEN_EXHAUSTED_ACTION
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PoolConfiguration()
           
PoolConfiguration(java.util.Properties properties)
           
 
Method Summary
 org.apache.commons.dbcp.AbandonedConfig getAbandonedConfig()
           
 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 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()
           
 java.lang.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 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(java.lang.String validationQuery)
           
 void setWhenExhaustedAction(byte whenExhaustedAction)
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, propertyNames, save, setProperty, store
 
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

EMPTY

public static final java.lang.String EMPTY
See Also:
Constant Field Values

MAX_ACTIVE

public static final java.lang.String MAX_ACTIVE
See Also:
Constant Field Values

MAX_IDLE

public static final java.lang.String MAX_IDLE
See Also:
Constant Field Values

MAX_WAIT

public static final java.lang.String MAX_WAIT
See Also:
Constant Field Values

WHEN_EXHAUSTED_ACTION

public static final java.lang.String WHEN_EXHAUSTED_ACTION
See Also:
Constant Field Values

TEST_ON_BORROW

public static final java.lang.String TEST_ON_BORROW
See Also:
Constant Field Values

TEST_ON_RETURN

public static final java.lang.String TEST_ON_RETURN
See Also:
Constant Field Values

TEST_WHILE_IDLE

public static final java.lang.String TEST_WHILE_IDLE
See Also:
Constant Field Values

TIME_BETWEEN_EVICTION_RUNS_MILLIS

public static final java.lang.String TIME_BETWEEN_EVICTION_RUNS_MILLIS
See Also:
Constant Field Values

NUM_TESTS_PER_EVICTION_RUN

public static final java.lang.String NUM_TESTS_PER_EVICTION_RUN
See Also:
Constant Field Values

MIN_EVICTABLE_IDLE_TIME_MILLIS

public static final java.lang.String MIN_EVICTABLE_IDLE_TIME_MILLIS
See Also:
Constant Field Values

LOG_ABANDONED

public static final java.lang.String LOG_ABANDONED
See Also:
Constant Field Values

REMOVE_ABANDONED

public static final java.lang.String REMOVE_ABANDONED
See Also:
Constant Field Values

REMOVE_ABANDONED_TIMEOUT

public static final java.lang.String REMOVE_ABANDONED_TIMEOUT
See Also:
Constant Field Values

VALIDATION_QUERY

public static final java.lang.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_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(java.util.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()

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 java.lang.String getValidationQuery()

setValidationQuery

public void setValidationQuery(java.lang.String validationQuery)

getMaxActive

public int getMaxActive()

setMaxActive

public void setMaxActive(int maxActive)

getMaxIdle

public int getMaxIdle()

setMaxIdle

public void setMaxIdle(int maxIdle)

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)


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14