Package io.agroal.pool
Class Poolless
java.lang.Object
io.agroal.pool.Poolless
- All Implemented Interfaces:
AgroalDataSourceConfiguration.MetricsEnabledListener,Pool,AutoCloseable
Alternative implementation of ConnectionPool for the special case of flush-on-close (and min-size == 0)
In particular, this removes the need for the executor. Also there is no thread-local connection cache as connections are not reused
- Author:
- Luis Barreiro
-
Constructor Summary
ConstructorsConstructorDescriptionPoolless(AgroalConnectionPoolConfiguration configuration, AgroalDataSourceListener... listeners) -
Method Summary
Modifier and TypeMethodDescriptionlonglonglongvoidclose()intvoidvoidinit()booleanisHealthy(boolean newConnection) longvoidonMetricsEnabled(boolean metricsEnabled) voidvoidreturnConnectionHandler(ConnectionHandler handler) voidsetPoolInterceptors(Collection<? extends AgroalPoolInterceptor> list)
-
Constructor Details
-
Poolless
public Poolless(AgroalConnectionPoolConfiguration configuration, AgroalDataSourceListener... listeners)
-
-
Method Details
-
init
public void init() -
getConfiguration
- Specified by:
getConfigurationin interfacePool
-
defaultJdbcIsolationLevel
public int defaultJdbcIsolationLevel()- Specified by:
defaultJdbcIsolationLevelin interfacePool
-
getListeners
- Specified by:
getListenersin interfacePool
-
getPoolInterceptors
- Specified by:
getPoolInterceptorsin interfacePool
-
setPoolInterceptors
- Specified by:
setPoolInterceptorsin interfacePool
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePool
-
getConnection
- Specified by:
getConnectionin interfacePool- Throws:
SQLException
-
returnConnectionHandler
- Specified by:
returnConnectionHandlerin interfacePool- Throws:
SQLException
-
onMetricsEnabled
public void onMetricsEnabled(boolean metricsEnabled) - Specified by:
onMetricsEnabledin interfaceAgroalDataSourceConfiguration.MetricsEnabledListener
-
getMetrics
- Specified by:
getMetricsin interfacePool
-
activeCount
public long activeCount()- Specified by:
activeCountin interfacePool
-
availableCount
public long availableCount()- Specified by:
availableCountin interfacePool
-
maxUsedCount
public long maxUsedCount()- Specified by:
maxUsedCountin interfacePool
-
resetMaxUsedCount
public void resetMaxUsedCount()- Specified by:
resetMaxUsedCountin interfacePool
-
awaitingCount
public long awaitingCount()- Specified by:
awaitingCountin interfacePool
-
isHealthy
- Specified by:
isHealthyin interfacePool- Throws:
SQLException
-
flushPool
-