List of usage examples for org.apache.commons.dbcp ThreadPoolingDataSource getPool
public ObjectPool getPool()
From source file:org.apache.cayenne.conf.CustomDBCPDataSourceFactory.java
/** * *//*from ww w.j av a2 s . c o m*/ @Override public void tearDown() { try { DataSource dataSource = CustomDataSourceUtil.getThreadDataSource(); if (dataSource instanceof ThreadPoolingDataSource) { ThreadPoolingDataSource poolingDataSource = (ThreadPoolingDataSource) dataSource; if (poolingDataSource != null) { ObjectPool pool = poolingDataSource.getPool(); if (pool != null) { try { pool.close(); } catch (Throwable t) { // } } } } } catch (Throwable t) { } }