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
ConstructorDescriptionPoolless
(AgroalConnectionPoolConfiguration configuration, AgroalDataSourceListener... listeners) -
Method Summary
Modifier and TypeMethodDescriptionlong
long
long
void
close()
int
void
void
init()
boolean
isHealthy
(boolean newConnection) long
void
onMetricsEnabled
(boolean metricsEnabled) void
void
returnConnectionHandler
(ConnectionHandler handler) void
setPoolInterceptors
(Collection<? extends AgroalPoolInterceptor> list)
-
Constructor Details
-
Poolless
public Poolless(AgroalConnectionPoolConfiguration configuration, AgroalDataSourceListener... listeners)
-
-
Method Details
-
init
public void init() -
getConfiguration
- Specified by:
getConfiguration
in interfacePool
-
defaultJdbcIsolationLevel
public int defaultJdbcIsolationLevel()- Specified by:
defaultJdbcIsolationLevel
in interfacePool
-
getListeners
- Specified by:
getListeners
in interfacePool
-
getPoolInterceptors
- Specified by:
getPoolInterceptors
in interfacePool
-
setPoolInterceptors
- Specified by:
setPoolInterceptors
in interfacePool
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacePool
-
getConnection
- Specified by:
getConnection
in interfacePool
- Throws:
SQLException
-
returnConnectionHandler
- Specified by:
returnConnectionHandler
in interfacePool
- Throws:
SQLException
-
onMetricsEnabled
public void onMetricsEnabled(boolean metricsEnabled) - Specified by:
onMetricsEnabled
in interfaceAgroalDataSourceConfiguration.MetricsEnabledListener
-
getMetrics
- Specified by:
getMetrics
in interfacePool
-
activeCount
public long activeCount()- Specified by:
activeCount
in interfacePool
-
availableCount
public long availableCount()- Specified by:
availableCount
in interfacePool
-
maxUsedCount
public long maxUsedCount()- Specified by:
maxUsedCount
in interfacePool
-
resetMaxUsedCount
public void resetMaxUsedCount()- Specified by:
resetMaxUsedCount
in interfacePool
-
awaitingCount
public long awaitingCount()- Specified by:
awaitingCount
in interfacePool
-
isHealthy
- Specified by:
isHealthy
in interfacePool
- Throws:
SQLException
-
flushPool
-