public class WinstoneDataSource extends Object implements DataSource, Runnable
| Modifier and Type | Field and Description |
|---|---|
static WinstoneResourceBundle |
DS_RESOURCES |
| Constructor and Description |
|---|
WinstoneDataSource(String name,
Map args,
ClassLoader loader)
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Close this pool - probably because we will want to re-init the pool
|
protected void |
executeKeepAlive(Connection connection) |
protected void |
executeKeepAliveOnUnused()
Executes keep alive for each of the connections in the supplied pool
|
Connection |
getConnection() |
protected Connection |
getConnection(int retriesAllowed)
Get a read-write connection - preferably from the pool, but fresh if needed
|
Connection |
getConnection(String username,
String password)
Gets a connection with a specific username/password.
|
int |
getLoginTimeout() |
PrintWriter |
getLogWriter() |
Logger |
getParentLogger() |
boolean |
isWrapperFor(Class<?> iface) |
protected void |
killPooledConnections(List pool,
int maxIdleCount)
Iterates through a list and kills off unused connections until we reach the
minimum idle count for that pool.
|
protected Connection |
makeNewRealConnection(List pool)
This makes a new rw connection.
|
void |
run()
Clean up and keep-alive thread.
|
void |
setLoginTimeout(int timeout) |
void |
setLogWriter(PrintWriter writer) |
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
public static final WinstoneResourceBundle DS_RESOURCES
public WinstoneDataSource(String name, Map args, ClassLoader loader)
public void destroy()
public Connection getConnection(String username, String password) throws SQLException
getConnection in interface DataSourceSQLExceptionpublic Connection getConnection() throws SQLException
getConnection in interface DataSourceSQLExceptionprotected Connection getConnection(int retriesAllowed) throws SQLException
SQLExceptionpublic int getLoginTimeout()
getLoginTimeout in interface CommonDataSourcepublic PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourcepublic void setLoginTimeout(int timeout)
setLoginTimeout in interface CommonDataSourcepublic void setLogWriter(PrintWriter writer)
setLogWriter in interface CommonDataSourcepublic void run()
protected void executeKeepAliveOnUnused()
protected void executeKeepAlive(Connection connection) throws SQLException
SQLExceptionprotected Connection makeNewRealConnection(List pool) throws SQLException
SQLExceptionprotected void killPooledConnections(List pool, int maxIdleCount)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger in interface CommonDataSourceSQLFeatureNotSupportedExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap in interface WrapperSQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor in interface WrapperSQLExceptionCopyright © 2014. All rights reserved.