public final class HikariPool extends java.lang.Object implements HikariPoolMBean, ConcurrentBag.IBagStateListener
| 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 |
closeConnection(IHikariConnectionProxy connectionProxy)
Permanently close the real (underlying) connection (eat any exception).
|
void |
closeIdleConnections() |
void |
dumpPoolState() |
int |
getActiveConnections() |
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 |
releaseConnection(IHikariConnectionProxy connectionProxy,
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.
|
java.lang.String |
toString() |
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(IHikariConnectionProxy connectionProxy, boolean isBroken)
connectionProxy - the connection 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 javax.sql.DataSource getDataSource()
public void closeConnection(IHikariConnectionProxy connectionProxy)
connectionProxy - the connection to actually closepublic 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 closeIdleConnections()
closeIdleConnections in interface HikariPoolMBeanpublic void dumpPoolState()
dumpPoolState in interface HikariPoolMBeanCopyright © 2014 Zaxxer.com. All Rights Reserved.