public final class HikariPool extends java.lang.Object implements HikariPoolMBean, ConcurrentBag.IBagStateListener
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
catalog |
boolean |
isAutoCommit |
boolean |
isReadOnly |
int |
transactionIsolation |
| Constructor and Description |
|---|
HikariPool(HikariConfig configuration)
Construct a HikariPool with the specified configuration.
|
HikariPool(HikariConfig configuration,
java.lang.String username,
java.lang.String password)
Construct a HikariPool with the specified configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBagItem() |
void |
evictConnection(IHikariConnectionProxy proxyConnection)
Evict a connection from the pool.
|
int |
getActiveConnections() |
HikariConfig |
getConfiguration()
Get the pool configuration object.
|
java.sql.Connection |
getConnection()
Get a connection from the pool, or timeout trying.
|
javax.sql.DataSource |
getDataSource()
Get the wrapped DataSource.
|
int |
getIdleConnections() |
int |
getThreadsAwaitingConnection() |
int |
getTotalConnections() |
void |
logPoolState(java.lang.String... prefix) |
void |
releaseConnection(PoolBagEntry bagEntry,
boolean isBroken)
Release a connection back to the pool, or permanently close it if it is broken.
|
void |
shutdown()
Shutdown the pool, closing all idle connections and aborting or closing
active connections.
|
void |
softEvictConnections() |
java.lang.String |
toString() |
public final java.lang.String catalog
public final boolean isReadOnly
public final boolean isAutoCommit
public int transactionIsolation
public HikariPool(HikariConfig configuration)
configuration - a HikariConfig instancepublic HikariPool(HikariConfig configuration, java.lang.String username, java.lang.String password)
configuration - a HikariConfig instanceusername - authentication usernamepassword - authentication passwordpublic java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLException - thrown if a timeout occurs trying to obtain a connectionpublic void releaseConnection(PoolBagEntry bagEntry, boolean isBroken)
bagEntry - the PoolBagEntry to release back to the poolisBroken - true if the connection was detected as brokenpublic void shutdown()
throws java.lang.InterruptedException
java.lang.InterruptedException - thrown if the thread is interrupted during shutdownpublic void evictConnection(IHikariConnectionProxy proxyConnection)
proxyConnection - the connection to evictpublic javax.sql.DataSource getDataSource()
public HikariConfig getConfiguration()
HikariConfig for this poolpublic java.lang.String toString()
toString in class java.lang.Objectpublic void addBagItem()
addBagItem in interface ConcurrentBag.IBagStateListenerpublic int getActiveConnections()
getActiveConnections in interface HikariPoolMBeanpublic int getIdleConnections()
getIdleConnections in interface HikariPoolMBeanpublic int getTotalConnections()
getTotalConnections in interface HikariPoolMBeanpublic int getThreadsAwaitingConnection()
getThreadsAwaitingConnection in interface HikariPoolMBeanpublic void softEvictConnections()
softEvictConnections in interface HikariPoolMBeanpublic void logPoolState(java.lang.String... prefix)
Copyright © 2014 Zaxxer.com. All Rights Reserved.