public final class HikariPool extends Object implements HikariPoolMBean, ConcurrentBag.IBagStateListener
Modifier and Type | Field and Description |
---|---|
String |
catalog |
boolean |
isAutoCommit |
boolean |
isReadOnly |
int |
transactionIsolation |
Constructor and Description |
---|
HikariPool(HikariConfig configuration)
Construct a HikariPool with the specified configuration.
|
HikariPool(HikariConfig configuration,
String username,
String password)
Construct a HikariPool with the specified configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addBagItem() |
void |
closeIdleConnections() |
void |
evictConnection(IHikariConnectionProxy proxyConnection)
Evict a connection from the pool.
|
int |
getActiveConnections() |
HikariConfig |
getConfiguration()
Get the pool configuration object.
|
Connection |
getConnection()
Get a connection from the pool, or timeout trying.
|
DataSource |
getDataSource()
Get the wrapped DataSource.
|
int |
getIdleConnections() |
int |
getThreadsAwaitingConnection() |
int |
getTotalConnections() |
void |
logPoolState(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.
|
String |
toString() |
public final String catalog
public final boolean isReadOnly
public final boolean isAutoCommit
public int transactionIsolation
public HikariPool(HikariConfig configuration)
configuration
- a HikariConfig instancepublic HikariPool(HikariConfig configuration, String username, String password)
configuration
- a HikariConfig instanceusername
- authentication usernamepassword
- authentication passwordpublic Connection getConnection() throws SQLException
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 InterruptedException
InterruptedException
- thrown if the thread is interrupted during shutdownpublic void evictConnection(IHikariConnectionProxy proxyConnection)
proxyConnection
- the connection to evictpublic DataSource getDataSource()
public HikariConfig getConfiguration()
HikariConfig
for this poolpublic void addBagItem()
addBagItem
in interface ConcurrentBag.IBagStateListener
public int getActiveConnections()
getActiveConnections
in interface HikariPoolMBean
public int getIdleConnections()
getIdleConnections
in interface HikariPoolMBean
public int getTotalConnections()
getTotalConnections
in interface HikariPoolMBean
public int getThreadsAwaitingConnection()
getThreadsAwaitingConnection
in interface HikariPoolMBean
public void closeIdleConnections()
closeIdleConnections
in interface HikariPoolMBean
public void logPoolState(String... prefix)
Copyright © 2014 Zaxxer.com. All Rights Reserved.