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.IBagStateListener
public final int getActiveConnections()
getActiveConnections
in interface HikariPoolMXBean
public final int getIdleConnections()
getIdleConnections
in interface HikariPoolMXBean
public final int getTotalConnections()
getTotalConnections
in interface HikariPoolMXBean
public final int getThreadsAwaitingConnection()
getThreadsAwaitingConnection
in interface HikariPoolMXBean
public void softEvictConnections()
softEvictConnections
in interface HikariPoolMXBean
public final void suspendPool()
suspendPool
in interface HikariPoolMXBean
public final void resumePool()
resumePool
in interface HikariPoolMXBean
public DataSource getUnwrappedDataSource()
Copyright © 2016 Zaxxer.com. All Rights Reserved.