public class ManagedPoolingDataSource extends Object implements PoolingDataSource, ScopeEventListener
UnmanagedPoolingDataSource that automatically manages
the underlying connection pool size.| Constructor and Description |
|---|
ManagedPoolingDataSource(UnmanagedPoolingDataSource dataSource) |
ManagedPoolingDataSource(UnmanagedPoolingDataSource dataSource,
long managerWakeTime) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeScopeEnd()
Calls
#shutdown() to drain the underlying pool, close open
connections and block the DataSource from creating any new connections. |
void |
close() |
Connection |
getConnection() |
Connection |
getConnection(String username,
String password) |
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> iface) |
void |
setLoginTimeout(int arg0) |
void |
setLogWriter(PrintWriter arg0) |
<T> T |
unwrap(Class<T> iface) |
public ManagedPoolingDataSource(UnmanagedPoolingDataSource dataSource)
public ManagedPoolingDataSource(UnmanagedPoolingDataSource dataSource, long managerWakeTime)
public void beforeScopeEnd()
#shutdown() to drain the underlying pool, close open
connections and block the DataSource from creating any new connections.beforeScopeEnd in interface ScopeEventListenerpublic void close()
close in interface AutoCloseablepublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter in interface CommonDataSourceSQLExceptionpublic int getLoginTimeout()
throws SQLException
getLoginTimeout in interface CommonDataSourceSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic void setLogWriter(PrintWriter arg0) throws SQLException
setLogWriter in interface CommonDataSourceSQLExceptionpublic void setLoginTimeout(int arg0)
throws SQLException
setLoginTimeout in interface CommonDataSourceSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionCopyright © 2001–2023 Apache Cayenne. All rights reserved.