public class WinstoneDataSource
extends java.lang.Object
implements javax.sql.DataSource, java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
static WinstoneResourceBundle |
DS_RESOURCES |
| Constructor and Description |
|---|
WinstoneDataSource(java.lang.String name,
java.util.Map args,
java.lang.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(java.sql.Connection connection) |
protected void |
executeKeepAliveOnUnused()
Executes keep alive for each of the connections in the supplied pool
|
java.sql.Connection |
getConnection() |
protected java.sql.Connection |
getConnection(int retriesAllowed)
Get a read-write connection - preferably from the pool, but fresh if needed
|
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
Gets a connection with a specific username/password.
|
int |
getLoginTimeout() |
java.io.PrintWriter |
getLogWriter() |
java.util.logging.Logger |
getParentLogger() |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
protected void |
killPooledConnections(java.util.List pool,
int maxIdleCount)
Iterates through a list and kills off unused connections until we reach the
minimum idle count for that pool.
|
protected java.sql.Connection |
makeNewRealConnection(java.util.List pool)
This makes a new rw connection.
|
void |
run()
Clean up and keep-alive thread.
|
void |
setLoginTimeout(int timeout) |
void |
setLogWriter(java.io.PrintWriter writer) |
java.lang.String |
toString() |
<T> T |
unwrap(java.lang.Class<T> iface) |
public static final WinstoneResourceBundle DS_RESOURCES
public WinstoneDataSource(java.lang.String name,
java.util.Map args,
java.lang.ClassLoader loader)
public void destroy()
public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionpublic java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface javax.sql.DataSourcejava.sql.SQLExceptionprotected java.sql.Connection getConnection(int retriesAllowed)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getLoginTimeout()
getLoginTimeout in interface javax.sql.CommonDataSourcepublic java.io.PrintWriter getLogWriter()
getLogWriter in interface javax.sql.CommonDataSourcepublic void setLoginTimeout(int timeout)
setLoginTimeout in interface javax.sql.CommonDataSourcepublic void setLogWriter(java.io.PrintWriter writer)
setLogWriter in interface javax.sql.CommonDataSourcepublic void run()
run in interface java.lang.Runnableprotected void executeKeepAliveOnUnused()
protected void executeKeepAlive(java.sql.Connection connection)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.sql.Connection makeNewRealConnection(java.util.List pool)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void killPooledConnections(java.util.List pool,
int maxIdleCount)
public java.util.logging.Logger getParentLogger()
throws java.sql.SQLFeatureNotSupportedException
getParentLogger in interface javax.sql.CommonDataSourcejava.sql.SQLFeatureNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLExceptionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLExceptionCopyright © 2013. All Rights Reserved.