| java.lang.Object winstone.jndi.resourceFactories.WinstoneDataSource
WinstoneDataSource | public class WinstoneDataSource implements DataSource,Runnable(Code) | | Implements a JDBC 2.0 pooling datasource. This is meant to act as a wrapper
around a JDBC 1.0 driver, just providing the pool management functions.
Supports keep alives, and check-connection-before-get options, as well
as normal reclaimable pool management options like maxIdle, maxConnections and
startConnections. Additionally it supports poll-retry on full, which means the
getConnection call will block and retry after a certain period when the pool
is maxed out (good for high load conditions).
This class was originally drawn from the generator-runtime servlet framework and
modified to make it more JDBC-API only compliant.
author: Rick Knowles version: $Id: WinstoneDataSource.java,v 1.8 2006/11/07 01:30:39 rickknowles Exp $ |
WinstoneDataSource | public WinstoneDataSource(String name, Map args, ClassLoader loader)(Code) | | Main constructor. Basically just calls the init method
|
destroy | public void destroy()(Code) | | Close this pool - probably because we will want to re-init the pool
|
executeKeepAliveOnUnused | protected void executeKeepAliveOnUnused()(Code) | | Executes keep alive for each of the connections in the supplied pool
|
getConnection | protected Connection getConnection(int retriesAllowed) throws SQLException(Code) | | Get a read-write connection - preferably from the pool, but fresh if needed
|
getLoginTimeout | public int getLoginTimeout()(Code) | | |
killPooledConnections | protected void killPooledConnections(List pool, int maxIdleCount)(Code) | | Iterates through a list and kills off unused connections until we reach the
minimum idle count for that pool.
|
makeNewRealConnection | protected Connection makeNewRealConnection(List pool) throws SQLException(Code) | | This makes a new rw connection. It assumes that the synchronization has taken
place in the calling code, so is unsafe for use outside this class.
|
run | public void run()(Code) | | Clean up and keep-alive thread.
Note - this needs a lot more attention to the semaphore use during keepAlive etc
|
setLoginTimeout | public void setLoginTimeout(int timeout)(Code) | | |
|
|