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.DataSource
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
protected java.sql.Connection getConnection(int retriesAllowed) throws java.sql.SQLException
java.sql.SQLException
public int getLoginTimeout()
getLoginTimeout
in interface javax.sql.CommonDataSource
public java.io.PrintWriter getLogWriter()
getLogWriter
in interface javax.sql.CommonDataSource
public void setLoginTimeout(int timeout)
setLoginTimeout
in interface javax.sql.CommonDataSource
public void setLogWriter(java.io.PrintWriter writer)
setLogWriter
in interface javax.sql.CommonDataSource
public void run()
run
in interface java.lang.Runnable
protected void executeKeepAliveOnUnused()
protected void executeKeepAlive(java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
protected java.sql.Connection makeNewRealConnection(java.util.List pool) throws java.sql.SQLException
java.sql.SQLException
protected void killPooledConnections(java.util.List pool, int maxIdleCount)
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException
public java.lang.String toString()
toString
in class java.lang.Object
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException
unwrap
in interface java.sql.Wrapper
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException
isWrapperFor
in interface java.sql.Wrapper
java.sql.SQLException
Copyright © 2013. All Rights Reserved.