|
Protomatter Software v1.1.7 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.protomatter.pool.SimpleObjectPool
|
+--com.protomatter.pool.GrowingObjectPool
|
+--com.protomatter.jdbc.pool.JdbcConnectionPool
Provides a pool of pre-opened JDBC connections. The configuration hashtable can contain the following:
java.sql.DriverManager,
JdbcConnectionPoolDriver,
JdbcConnectionPoolConnection| Fields inherited from class com.protomatter.pool.SimpleObjectPool |
sync |
| Constructor Summary | |
JdbcConnectionPool(java.lang.String name)
Create a new JDBC connection pool with the given name. |
|
JdbcConnectionPool(java.lang.String name,
java.util.Map args)
Create a new JDBC connection pool with the given name, and the given initialization parameters. |
|
JdbcConnectionPool(java.lang.String name,
java.util.Properties props)
Create a connection pool from properties. |
|
| Method Summary | |
void |
closeAllConnections()
Shutdown all the connections that this pool has open and checked in. |
protected ObjectPoolObject |
createObjectPoolObject()
Used internally for growing the pool. |
static java.util.List |
createPools(java.util.Properties props)
Create pools from a properties object. |
java.lang.String |
getName()
Get the name of this pool. |
java.lang.Object |
getSyslogChannel()
Get the channel(s) to log messages to. |
java.lang.String |
getValidityCheckStatement()
Get the statement set as the validity check statement. |
void |
init(java.util.Map args)
Initialize the pool. |
void |
refreshConnections()
Performs a non-verbose refresh of the connections. |
void |
refreshConnections(boolean verbose)
Refresh the connections. |
void |
setSyslogChannel(java.lang.String channelName)
Set the channel that messages will be logged to. |
void |
setSyslogChannelList(java.util.List channelList)
Set the list of channels that messages will be logged to. |
void |
unRegisterPool()
Remove this pool from the JdbcConnectionPoolDriver's list of known pools. |
| Methods inherited from class com.protomatter.pool.GrowingObjectPool |
checkinPoolObject, getCreateWaitTime, getCurrentPoolSize, getInitialObjectPoolSize, getMaxObjectPoolSize, getNextPoolObject, getObjectPoolGrowSize, getObjectPoolSize, getPool, reInitializeObjectPool, setMaxObjectPoolSize |
| Methods inherited from class com.protomatter.pool.SimpleObjectPool |
checkin, checkout, getCheckedOutObjects, getNumWaiters, getObjectsInUse, getSyncObject |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JdbcConnectionPool(java.lang.String name,
java.util.Map args)
throws java.lang.Exception
name - The name of the pool.args - Initialization arguments.java.lang.Exception - If there is a problem initializing the pool.init(java.util.Map)
public JdbcConnectionPool(java.lang.String name,
java.util.Properties props)
throws java.lang.Exception
##
## Pool initialization parameters. These each
## correspond to parameters passed into the
## init(ht) method -- the values are each
## converted to the appropriate type. The
## "jdbc.properties" option is not specified
## here.
##
com.protomatter.jdbc.pool.POOLNAME=\
jdbc.driver=driverclass,\
jdbc.URL=connection_URL,\
jdbc.validityCheckStatement=driverclass,\
pool.maxCheckoutRefreshAttempts=num_attempts,\
pool.checkoutRefreshWaitTime=num_milliseconds,\
pool.refreshThreadCheckInterval=num_seconds,\
pool.verboseRefresh=true or false,\
pool.verboseValidate=true or false,\
pool.initialSize=initial_pool_size,\
pool.maxSize=max_pool_size,\
pool.growBlock=pool_grow_block_size,\
pool.createWaitTime=pool_create_wait_time,\
pool.maidThreadCheckInterval=num_seconds,\
pool.maxConnectionIdleTime=num_seconds,\
pool.validateOnCheckout=true or false,\
pool.syslogChannelList=list-of-channel-names
##
## Connection properties for the underlying driver.
## These correspond to the properties that are
## placed in the configuraton hashtable with the
## key "jdbc.properties". These will be passed as
## the second argument to DriverManager.getConnection().
## Usually it just contains a usename and a password, but
## many drivers allow you to specify other options here.
##
com.protomatter.jdbc.pool.POOLNAME.jdbcProperties=\
user=username,\
password=password,\
key=val
Each value specified in the properties is converted to the correct type (for instance, the "pool.initialSize" property's value is converted to an Integer). The "POOLNAME" that appears above must match the "name" parameter passed to this method -- this allows to the same properties object to be passed into this constructor multiple times (each with a different "name" parameter) to create multiple pools.
name - The name of the pool.props - Properties describing pools.init(java.util.Map)public JdbcConnectionPool(java.lang.String name)
name - The name of the pool.init(java.util.Map)| Method Detail |
public java.lang.Object getSyslogChannel()
getSyslogChannel in interface SyslogChannelAwareSyslogChannelAwarepublic void setSyslogChannel(java.lang.String channelName)
SyslogChannelAwarepublic void setSyslogChannelList(java.util.List channelList)
SyslogChannelAware
public static java.util.List createPools(java.util.Properties props)
throws java.lang.Exception
JdbcConnectionPool(String, Properties)
constructor, and creates a connection pool for each. The
resulting pools are placed in a List and returned.JdbcConnectionPool(String, Properties)public void unRegisterPool()
public java.lang.String getName()
public void closeAllConnections()
public void refreshConnections(boolean verbose)
throws java.sql.SQLException
java.sql.SQLException - If there is a problem refreshing connections.JdbcConnectionPoolConnection.refresh(boolean)
public void refreshConnections()
throws java.sql.SQLException
refreshConnections(boolean)
public void init(java.util.Map args)
throws java.lang.Exception
The other options listed above are read by this class's superclass,
com.protomatter.pool.GrowingObjectPool.
This method is called by the constructor that takes a String and a Map. Calling this method multiple times will have no effect on the pool since all but the first call are ignored.
init in class GrowingObjectPooljava.lang.Exception - If there is a problem initializing the pool.GrowingObjectPool.init(java.util.Map)
protected ObjectPoolObject createObjectPoolObject()
throws java.sql.SQLException
createObjectPoolObject in class SimpleObjectPooljava.sql.SQLException - If there is a problem creating a new connection.public java.lang.String getValidityCheckStatement()
init(java.util.Map)
|
Protomatter Software v1.1.7 Copyright 1998-2002 Nate Sammons |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Protomatter Software v1.1.7 | http://protomatter.sourceforge.net/1.1.7 |