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 ScopeEventListener
public void close()
close
in interface AutoCloseable
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
SQLException
public Connection getConnection(String username, String password) throws SQLException
getConnection
in interface DataSource
SQLException
public PrintWriter getLogWriter() throws SQLException
getLogWriter
in interface CommonDataSource
SQLException
public int getLoginTimeout() throws SQLException
getLoginTimeout
in interface CommonDataSource
SQLException
public boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor
in interface Wrapper
SQLException
public void setLogWriter(PrintWriter arg0) throws SQLException
setLogWriter
in interface CommonDataSource
SQLException
public void setLoginTimeout(int arg0) throws SQLException
setLoginTimeout
in interface CommonDataSource
SQLException
public <T> T unwrap(Class<T> iface) throws SQLException
unwrap
in interface Wrapper
SQLException
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger
in interface CommonDataSource
SQLFeatureNotSupportedException
Copyright © 2001–2017 Apache Cayenne. All rights reserved.