org.apache.commons.dbcp
Class AbandonedObjectPool

java.lang.Object
  |
  +--org.apache.commons.pool.BaseObjectPool
        |
        +--org.apache.commons.pool.impl.GenericObjectPool
              |
              +--org.apache.commons.dbcp.AbandonedObjectPool
All Implemented Interfaces:
org.apache.commons.pool.ObjectPool

public class AbandonedObjectPool
extends org.apache.commons.pool.impl.GenericObjectPool

An implementation of a Jakarta-Commons ObjectPool which tracks JDBC connections and can recover abandoned db connections. If logAbandoned=true, a stack trace will be printed for any abandoned db connections recovered.

Version:
$Revision: 1.2 $ $Date: 2002/06/23 21:41:42 $
Author:
Glenn L. Nielsen

Inner classes inherited from class org.apache.commons.pool.impl.GenericObjectPool
org.apache.commons.pool.impl.GenericObjectPool.Config
 
Fields inherited from class org.apache.commons.pool.impl.GenericObjectPool
_evictor, _factory, _maxActive, _maxIdle, _maxWait, _minEvictableIdleTimeMillis, _numActive, _numTestsPerEvictionRun, _pool, _testOnBorrow, _testOnReturn, _testWhileIdle, _timeBetweenEvictionRunsMillis, _whenExhaustedAction, DEFAULT_MAX_ACTIVE, DEFAULT_MAX_IDLE, DEFAULT_MAX_WAIT, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TEST_WHILE_IDLE, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_WHEN_EXHAUSTED_ACTION, WHEN_EXHAUSTED_BLOCK, WHEN_EXHAUSTED_FAIL, WHEN_EXHAUSTED_GROW
 
Constructor Summary
AbandonedObjectPool(org.apache.commons.pool.PoolableObjectFactory factory, AbandonedConfig config)
          Create an ObjectPool which tracks db connections.
 
Method Summary
 java.lang.Object borrowObject()
          Get a db connection from the pool.
 void returnObject(java.lang.Object obj)
          Return a db connection to the pool.
 
Methods inherited from class org.apache.commons.pool.impl.GenericObjectPool
clear, close, getMaxActive, getMaxIdle, getMaxWait, getMinEvictableIdleTimeMillis, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getTestOnBorrow, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getWhenExhaustedAction, setConfig, setFactory, setMaxActive, setMaxIdle, setMaxWait, setMinEvictableIdleTimeMillis, setNumTestsPerEvictionRun, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setWhenExhaustedAction
 
Methods inherited from class org.apache.commons.pool.BaseObjectPool
numActive, numIdle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbandonedObjectPool

public AbandonedObjectPool(org.apache.commons.pool.PoolableObjectFactory factory,
                           AbandonedConfig config)
Create an ObjectPool which tracks db connections.
Parameters:
PoolableObjectFactory - factory used to create this
AbandonedConfig - configuration for abandoned db connections
Method Detail

borrowObject

public java.lang.Object borrowObject()
                              throws java.lang.Exception
Get a db connection from the pool. If removeAbandoned=true, recovers db connections which have been idle > removeAbandonedTimeout.
Overrides:
borrowObject in class org.apache.commons.pool.impl.GenericObjectPool
Returns:
Object jdbc Connection

returnObject

public void returnObject(java.lang.Object obj)
                  throws java.lang.Exception
Return a db connection to the pool.
Overrides:
returnObject in class org.apache.commons.pool.impl.GenericObjectPool
Parameters:
Object - db Connection to return


Copyright © 2001 Apache Software Foundation. Documenation generated February 27 2003.