public class HikariPool extends Object implements HikariPoolMXBean, ConcurrentBag.IBagStateListener
| Modifier and Type | Class and Description |
|---|---|
static class |
HikariPool.PoolInitializationException |
| Constructor and Description |
|---|
HikariPool(HikariConfig config)
Construct a HikariPool with the specified configuration.
|
| Modifier and Type | Method and Description |
|---|---|
Future<Boolean> |
addBagItem() |
void |
evictConnection(Connection connection)
Evict a connection from the pool.
|
int |
getActiveConnections() |
Connection |
getConnection()
Get a connection from the pool, or timeout after connectionTimeout milliseconds.
|
Connection |
getConnection(long hardTimeout)
Get a connection from the pool, or timeout after the specified number of milliseconds.
|
int |
getIdleConnections() |
int |
getThreadsAwaitingConnection() |
int |
getTotalConnections() |
DataSource |
getUnwrappedDataSource() |
void |
resumePool() |
void |
setHealthCheckRegistry(Object healthCheckRegistry) |
void |
setMetricRegistry(Object metricRegistry) |
void |
setMetricsTrackerFactory(MetricsTrackerFactory metricsTrackerFactory) |
void |
shutdown()
Shutdown the pool, closing all idle connections and aborting or closing
active connections.
|
void |
softEvictConnections() |
void |
suspendPool() |
String |
toString() |
public HikariPool(HikariConfig config)
config - a HikariConfig instancepublic final Connection getConnection() throws SQLException
SQLException - thrown if a timeout occurs trying to obtain a connectionpublic final Connection getConnection(long hardTimeout) throws SQLException
hardTimeout - the maximum time to wait for a connection from the poolSQLException - thrown if a timeout occurs trying to obtain a connectionpublic final void shutdown()
throws InterruptedException
InterruptedException - thrown if the thread is interrupted during shutdownpublic final void evictConnection(Connection connection)
connection - the connection to evictpublic void setMetricRegistry(Object metricRegistry)
public void setMetricsTrackerFactory(MetricsTrackerFactory metricsTrackerFactory)
public void setHealthCheckRegistry(Object healthCheckRegistry)
public Future<Boolean> addBagItem()
addBagItem in interface ConcurrentBag.IBagStateListenerpublic final int getActiveConnections()
getActiveConnections in interface HikariPoolMXBeanpublic final int getIdleConnections()
getIdleConnections in interface HikariPoolMXBeanpublic final int getTotalConnections()
getTotalConnections in interface HikariPoolMXBeanpublic final int getThreadsAwaitingConnection()
getThreadsAwaitingConnection in interface HikariPoolMXBeanpublic void softEvictConnections()
softEvictConnections in interface HikariPoolMXBeanpublic final void suspendPool()
suspendPool in interface HikariPoolMXBeanpublic final void resumePool()
resumePool in interface HikariPoolMXBeanpublic DataSource getUnwrappedDataSource()
Copyright © 2016 Zaxxer.com. All Rights Reserved.