Package org.apache.cayenne.datasource
Class ManagedPoolingDataSource
java.lang.Object
org.apache.cayenne.datasource.ManagedPoolingDataSource
- All Implemented Interfaces:
- AutoCloseable,- Wrapper,- CommonDataSource,- DataSource,- PoolingDataSource,- ScopeEventListener
public class ManagedPoolingDataSource extends Object implements PoolingDataSource, ScopeEventListener
A wrapper for 
UnmanagedPoolingDataSource that automatically manages
 the underlying connection pool size.- Since:
- 4.0
- 
Constructor SummaryConstructors Constructor Description ManagedPoolingDataSource(UnmanagedPoolingDataSource dataSource)ManagedPoolingDataSource(UnmanagedPoolingDataSource dataSource, long managerWakeTime)
- 
Method SummaryModifier and Type Method Description voidbeforeScopeEnd()Calls#shutdown()to drain the underlying pool, close open connections and block the DataSource from creating any new connections.voidclose()ConnectiongetConnection()ConnectiongetConnection(String username, String password)intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()booleanisWrapperFor(Class<?> iface)voidsetLoginTimeout(int arg0)voidsetLogWriter(PrintWriter arg0)<T> Tunwrap(Class<T> iface)Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSourcecreateShardingKeyBuilderMethods inherited from interface javax.sql.DataSourcecreateConnectionBuilder
- 
Constructor Details- 
ManagedPoolingDataSource
- 
ManagedPoolingDataSource
 
- 
- 
Method Details- 
beforeScopeEndpublic void beforeScopeEnd()Calls#shutdown()to drain the underlying pool, close open connections and block the DataSource from creating any new connections.- Specified by:
- beforeScopeEndin interface- ScopeEventListener
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
- 
getConnection- Specified by:
- getConnectionin interface- DataSource
- Throws:
- SQLException
 
- 
getConnection- Specified by:
- getConnectionin interface- DataSource
- Throws:
- SQLException
 
- 
getLogWriter- Specified by:
- getLogWriterin interface- CommonDataSource
- Specified by:
- getLogWriterin interface- DataSource
- Throws:
- SQLException
 
- 
getLoginTimeout- Specified by:
- getLoginTimeoutin interface- CommonDataSource
- Specified by:
- getLoginTimeoutin interface- DataSource
- Throws:
- SQLException
 
- 
isWrapperFor- Specified by:
- isWrapperForin interface- Wrapper
- Throws:
- SQLException
 
- 
setLogWriter- Specified by:
- setLogWriterin interface- CommonDataSource
- Specified by:
- setLogWriterin interface- DataSource
- Throws:
- SQLException
 
- 
setLoginTimeout- Specified by:
- setLoginTimeoutin interface- CommonDataSource
- Specified by:
- setLoginTimeoutin interface- DataSource
- Throws:
- SQLException
 
- 
unwrap- Specified by:
- unwrapin interface- Wrapper
- Throws:
- SQLException
 
- 
getParentLogger- Specified by:
- getParentLoggerin interface- CommonDataSource
- Throws:
- SQLFeatureNotSupportedException
 
 
-