Top Fields Constructors Methods
com.mchange.v2.c3p0.impl

public final Class C3P0PooledConnectionPoolManager

extends Object
Class Inheritance
Imports
java.beans.*, java.util.*, java.lang.reflect.*, java.sql.*, javax.sql.*, com.mchange.v2.c3p0.*, com.mchange.v2.c3p0.cfg.*, com.mchange.v2.async.*, com.mchange.v2.coalesce.*, com.mchange.v1.db.sql.*, com.mchange.v2.log.*, com.mchange.v1.lang.BooleanUtils, com.mchange.v2.sql.SqlUtils, com.mchange.v2.resourcepool.ResourcePoolFactory, .BasicResourcePoolFactory

Field Summary

Modifier and TypeField and Description
pack-priv Map<K, V>
private static final CoalesceChecker
pack-priv static final Coalescer
pack-priv final ConnectionPoolDataSource
private static final TaskRunnerFactory
pack-priv final DbAuth
pack-priv ThreadPoolReportingAsynchronousRunner
pack-priv static final int
pack-priv final Map<K, V>
private static final MLogger
pack-priv int
pack-priv final String
pack-priv final String
private static final boolean
pack-priv final Map<K, V>
pack-priv ResourcePoolFactory
pack-priv ThreadPoolReportingAsynchronousRunner
pack-priv Timer
pack-priv final Map<K, V>

Constructor Summary

AccessConstructor and Description
public
C3P0PooledConnectionPoolManager(ConnectionPoolDataSource cpds, Map<K, V> flatPropertyOverrides, Map<K, V> forceUserOverrides, int num_task_threads, String parentDataSourceIdentityToken, String parentDataSourceName)

Method Summary

Modifier and TypeMethod and Description
private boolean
checkAutomaticTestTable(String automaticTestTable)

public void
public synchronized void
close(boolean close_outstanding_connections)

private C3P0PooledConnectionPool
private ThreadPoolReportingAsynchronousRunner
createTaskRunner(int num_threads_if_supported, int max_administrative_task_time_if_supported, String contextClassLoaderSourceIfSupported, boolean privilege_spawned_threads_if_supported, String threadLabelIfSupported, ConnectionPoolDataSource cpds, Timer timer)

private void
protected synchronized void
finalize()

Overrides java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

private int
private int
private int
private boolean
public String
private boolean
getBoolean(String propName, String userName)

private boolean
private int
private ConnectionCustomizer
private String
private int
private ConnectionTester
private String
private String
private boolean
private boolean
private int
private int
private int
getInt(String propName, String userName)

public synchronized Set<E>
private String
private int
private int
private int
private int
private int
private int
private int
public int
public synchronized int
public synchronized int
public synchronized int
public synchronized int
public synchronized int
private Object
getObject(String propName, String userName)

public synchronized C3P0PooledConnectionPool
getPool(String username, String password, boolean create)

public C3P0PooledConnectionPool
getPool(String username, String password)

public synchronized C3P0PooledConnectionPool
public C3P0PooledConnectionPool
public String
private boolean
private int
public synchronized int
public synchronized int
private int
public synchronized int
public int
public synchronized int
public synchronized int
public synchronized int
public int
public int
public int
public String
public String
private String
getString(String propName, String userName)

private TaskRunnerFactory
private String
private boolean
private boolean
public int
public int
public int
public int
public String
public String
private int
private String
private String
initializeAutomaticTestTable(String automaticTestTable, DbAuth auth)

private void
private synchronized void
poolsDestroy(boolean close_outstanding_connections)

private void
public synchronized void
Inherited from java.lang.Object:
cloneequalsgetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

authsToPoolsback to summary
pack-priv Map<K, V> authsToPools
COALESCE_CHECKERback to summary
private static final CoalesceChecker COALESCE_CHECKER
COALESCERback to summary
pack-priv static final Coalescer COALESCER
cpdsback to summary
pack-priv final ConnectionPoolDataSource cpds
DEFAULT_TASK_RUNNER_FACTORYback to summary
private static final TaskRunnerFactory DEFAULT_TASK_RUNNER_FACTORY
defaultAuthback to summary
pack-priv final DbAuth defaultAuth
deferredStatementDestroyerback to summary
pack-priv ThreadPoolReportingAsynchronousRunner deferredStatementDestroyer
DFLT_NUM_TASK_THREADS_PER_DATA_SOURCEback to summary
pack-priv static final int DFLT_NUM_TASK_THREADS_PER_DATA_SOURCE
flatPropertyOverridesback to summary
pack-priv final Map<K, V> flatPropertyOverrides
loggerback to summary
private static final MLogger logger
num_task_threadsback to summary
pack-priv int num_task_threads
parentDataSourceIdentityTokenback to summary
pack-priv final String parentDataSourceIdentityToken
parentDataSourceNameback to summary
pack-priv final String parentDataSourceName
POOL_EVENT_SUPPORTback to summary
private static final boolean POOL_EVENT_SUPPORT
propNamesToReadMethodsback to summary
pack-priv final Map<K, V> propNamesToReadMethods
rpfactback to summary
pack-priv ResourcePoolFactory rpfact
taskRunnerback to summary
pack-priv ThreadPoolReportingAsynchronousRunner taskRunner
timerback to summary
pack-priv Timer timer
userOverridesback to summary
pack-priv final Map<K, V> userOverrides

Constructor Detail

C3P0PooledConnectionPoolManagerback to summary
public C3P0PooledConnectionPoolManager(ConnectionPoolDataSource cpds, Map<K, V> flatPropertyOverrides, Map<K, V> forceUserOverrides, int num_task_threads, String parentDataSourceIdentityToken, String parentDataSourceName) throws SQLException

Method Detail

checkAutomaticTestTableback to summary
private boolean checkAutomaticTestTable(String automaticTestTable)
closeback to summary
public void close()
closeback to summary
public synchronized void close(boolean close_outstanding_connections)
createPooledConnectionPoolback to summary
private C3P0PooledConnectionPool createPooledConnectionPool(DbAuth auth) throws SQLException
createTaskRunnerback to summary
private ThreadPoolReportingAsynchronousRunner createTaskRunner(int num_threads_if_supported, int max_administrative_task_time_if_supported, String contextClassLoaderSourceIfSupported, boolean privilege_spawned_threads_if_supported, String threadLabelIfSupported, ConnectionPoolDataSource cpds, Timer timer)
ensureFirstConnectionAcquisitionback to summary
private void ensureFirstConnectionAcquisition(DbAuth auth) throws SQLException
finalizeback to summary
protected synchronized void finalize()

Overrides java.lang.Object.finalize.

Doc from java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the finalize method to dispose of system resources or to perform other cleanup.

When running in a Java virtual machine in which finalization has been disabled or removed, the garbage collector will never call finalize(). In a Java virtual machine in which finalization is enabled, the garbage collector might call finalize only after an indefinite delay.

The general contract of finalize is that it is invoked if and when the Java virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The finalize method may take any action, including making this object available again to other threads; the usual purpose of finalize, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.

The finalize method of class Object performs no special action; it simply returns normally. Subclasses of Object may override this definition.

The Java programming language does not guarantee which thread will invoke the finalize method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

After the finalize method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.

The finalize method is never invoked more than once by a Java virtual machine for any given object.

Any exception thrown by the finalize method causes the finalization of this object to be halted, but is otherwise ignored.

getAcquireIncrementback to summary
private int getAcquireIncrement(String userName)
getAcquireRetryAttemptsback to summary
private int getAcquireRetryAttempts(String userName)
getAcquireRetryDelayback to summary
private int getAcquireRetryDelay(String userName)
getAttemptResurrectOnCheckinback to summary
private boolean getAttemptResurrectOnCheckin(String userName)
getAutomaticTestTableback to summary
public String getAutomaticTestTable(String userName)
getBooleanback to summary
private boolean getBoolean(String propName, String userName) throws Exception
getBreakAfterAcquireFailureback to summary
private boolean getBreakAfterAcquireFailure(String userName)
getCheckoutTimeoutback to summary
private int getCheckoutTimeout(String userName)
getConnectionCustomizerback to summary
private ConnectionCustomizer getConnectionCustomizer(String userName) throws SQLException
getConnectionCustomizerClassNameback to summary
private String getConnectionCustomizerClassName(String userName)
getConnectionIsValidTimeoutback to summary
private int getConnectionIsValidTimeout(String userName)
getConnectionTesterback to summary
private ConnectionTester getConnectionTester(String userName)
getConnectionTesterClassNameback to summary
private String getConnectionTesterClassName(String userName)
getContextClassLoaderSourceback to summary
private String getContextClassLoaderSource()
getDebugUnreturnedConnectionStackTracesback to summary
private boolean getDebugUnreturnedConnectionStackTraces(String userName)
getForceSynchronousCheckinsback to summary
private boolean getForceSynchronousCheckins(String userName)
getIdleConnectionTestPeriodback to summary
private int getIdleConnectionTestPeriod(String userName)
getInitialPoolSizeback to summary
private int getInitialPoolSize(String userName)
getIntback to summary
private int getInt(String propName, String userName) throws Exception
getManagedAuthsback to summary
public synchronized Set<E> getManagedAuths()
getMarkSessionBoundariesback to summary
private String getMarkSessionBoundaries(String userName)
getMaxAdministrativeTaskTimeback to summary
private int getMaxAdministrativeTaskTime()
getMaxConnectionAgeback to summary
private int getMaxConnectionAge(String userName)
getMaxIdleTimeback to summary
private int getMaxIdleTime(String userName)
getMaxIdleTimeExcessConnectionsback to summary
private int getMaxIdleTimeExcessConnections(String userName)
getMaxPoolSizeback to summary
private int getMaxPoolSize(String userName)
getMaxStatementsback to summary
private int getMaxStatements(String userName)
getMaxStatementsPerConnectionback to summary
private int getMaxStatementsPerConnection(String userName)
getMinPoolSizeback to summary
public int getMinPoolSize(String userName)
getNumBusyConnectionsAllAuthsback to summary
public synchronized int getNumBusyConnectionsAllAuths() throws SQLException
getNumConnectionsAllAuthsback to summary
public synchronized int getNumConnectionsAllAuths() throws SQLException
getNumIdleConnectionsAllAuthsback to summary
public synchronized int getNumIdleConnectionsAllAuths() throws SQLException
getNumManagedAuthsback to summary
public synchronized int getNumManagedAuths()
getNumUnclosedOrphanedConnectionsAllAuthsback to summary
public synchronized int getNumUnclosedOrphanedConnectionsAllAuths() throws SQLException
getObjectback to summary
private Object getObject(String propName, String userName)
getPoolback to summary
public synchronized C3P0PooledConnectionPool getPool(String username, String password, boolean create) throws SQLException
getPoolback to summary
public C3P0PooledConnectionPool getPool(String username, String password) throws SQLException
getPoolback to summary
public synchronized C3P0PooledConnectionPool getPool(DbAuth auth) throws SQLException
getPoolback to summary
public C3P0PooledConnectionPool getPool() throws SQLException
getPreferredTestQueryback to summary
public String getPreferredTestQuery(String userName)
getPrivilegeSpawnedThreadsback to summary
private boolean getPrivilegeSpawnedThreads()
getPropertyCycleback to summary
private int getPropertyCycle(String userName)
getStatementCacheNumCheckedOutStatementsAllUsersback to summary
public synchronized int getStatementCacheNumCheckedOutStatementsAllUsers() throws SQLException
getStatementCacheNumConnectionsWithCachedStatementsAllUsersback to summary
public synchronized int getStatementCacheNumConnectionsWithCachedStatementsAllUsers() throws SQLException
getStatementCacheNumDeferredCloseThreadsback to summary
private int getStatementCacheNumDeferredCloseThreads()
getStatementCacheNumStatementsAllUsersback to summary
public synchronized int getStatementCacheNumStatementsAllUsers() throws SQLException
getStatementDestroyerNumActiveThreadsback to summary
public int getStatementDestroyerNumActiveThreads()
getStatementDestroyerNumConnectionsInUseAllUsersback to summary
public synchronized int getStatementDestroyerNumConnectionsInUseAllUsers() throws SQLException
getStatementDestroyerNumConnectionsWithDeferredDestroyStatementsAllUsersback to summary
public synchronized int getStatementDestroyerNumConnectionsWithDeferredDestroyStatementsAllUsers() throws SQLException
getStatementDestroyerNumDeferredDestroyStatementsAllUsersback to summary
public synchronized int getStatementDestroyerNumDeferredDestroyStatementsAllUsers() throws SQLException
getStatementDestroyerNumIdleThreadsback to summary
public int getStatementDestroyerNumIdleThreads()
getStatementDestroyerNumTasksPendingback to summary
public int getStatementDestroyerNumTasksPending()
getStatementDestroyerNumThreadsback to summary
public int getStatementDestroyerNumThreads()
getStatementDestroyerStackTracesback to summary
public String getStatementDestroyerStackTraces()
getStatementDestroyerStatusback to summary
public String getStatementDestroyerStatus()
getStringback to summary
private String getString(String propName, String userName)
getTaskRunnerFactoryback to summary
private TaskRunnerFactory getTaskRunnerFactory(String userName)
getTaskRunnerFactoryClassNameback to summary
private String getTaskRunnerFactoryClassName(String userName)
getTestConnectionOnCheckinback to summary
private boolean getTestConnectionOnCheckin(String userName)
getTestConnectionOnCheckoutback to summary
private boolean getTestConnectionOnCheckout(String userName)
getThreadPoolNumActiveThreadsback to summary
public int getThreadPoolNumActiveThreads()
getThreadPoolNumIdleThreadsback to summary
public int getThreadPoolNumIdleThreads()
getThreadPoolNumTasksPendingback to summary
public int getThreadPoolNumTasksPending()
getThreadPoolSizeback to summary
public int getThreadPoolSize()
getThreadPoolStackTracesback to summary
public String getThreadPoolStackTraces()
getThreadPoolStatusback to summary
public String getThreadPoolStatus()
getUnreturnedConnectionTimeoutback to summary
private int getUnreturnedConnectionTimeout(String userName)
idStringback to summary
private String idString()
initializeAutomaticTestTableback to summary
private String initializeAutomaticTestTable(String automaticTestTable, DbAuth auth) throws SQLException
poolsDestroyback to summary
private void poolsDestroy()
poolsDestroyback to summary
private synchronized void poolsDestroy(boolean close_outstanding_connections)
poolsInitback to summary
private void poolsInit()
softResetAllAuthsback to summary
public synchronized void softResetAllAuths() throws SQLException