Class AgroalConnectionPoolConfigurationSupplier
java.lang.Object
io.agroal.api.configuration.supplier.AgroalConnectionPoolConfigurationSupplier
- All Implemented Interfaces:
Supplier<AgroalConnectionPoolConfiguration>
public class AgroalConnectionPoolConfigurationSupplier
extends Object
implements Supplier<AgroalConnectionPoolConfiguration>
Builder of AgroalConnectionPoolConfiguration.
- Author:
- Luis Barreiro
-
Constructor Summary
ConstructorsConstructorDescriptionAgroalConnectionPoolConfigurationSupplier(AgroalConnectionPoolConfiguration existingConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionacquisitionTimeout(Duration timeout) Sets the duration of the acquisition timeout.connectionCache(ConnectionCache cache) Sets the connection cache implementation.Allows access to the configuration builder for the connection pool.connectionFactoryConfiguration(Function<? super AgroalConnectionFactoryConfigurationSupplier, ? extends AgroalConnectionFactoryConfigurationSupplier> function) Modifies the configuration of the connection pool.connectionFactoryConfiguration(Supplier<? extends AgroalConnectionFactoryConfiguration> supplier) Sets the configuration for the connection factory.Sets the connection validation method.Enables enhanced leak report.enhancedLeakReport(boolean enhanced) Enables or disables enhanced leak report.Sets the exception sorter.Enables flushing of connections on close.flushOnClose(boolean flush) Enables or disables flushing of connections on close.get()idleValidationTimeout(Duration timeout) Sets the duration of idle time for foreground validation to be executed.initialSize(int size) Sets the number of connections when the pool starts.leakTimeout(Duration timeout) Sets the duration of the leak timeout detection.maxLifetime(Duration time) Sets the duration for the lifetime of connections.maxSize(int size) Sets the maximum number of connections on the pool.minSize(int size) Sets the minimum number of connections on the pool.Sets the behaviour of the pool when a thread tries to acquire multiple connections.reapTimeout(Duration timeout) Sets the duration for eviction of idle connections.transactionIntegration(TransactionIntegration integration) Sets the transaction integration instance to use.Sets the transaction requirements for the pool.validateOnBorrow(boolean validate) Enables validation on borrow.validationTimeout(Duration timeout) Sets the duration of background validation interval.
-
Constructor Details
-
AgroalConnectionPoolConfigurationSupplier
public AgroalConnectionPoolConfigurationSupplier() -
AgroalConnectionPoolConfigurationSupplier
public AgroalConnectionPoolConfigurationSupplier(AgroalConnectionPoolConfiguration existingConfiguration)
-
-
Method Details
-
connectionFactoryConfiguration
public AgroalConnectionPoolConfigurationSupplier connectionFactoryConfiguration(Supplier<? extends AgroalConnectionFactoryConfiguration> supplier) Sets the configuration for the connection factory. -
connectionFactoryConfiguration
public AgroalConnectionPoolConfigurationSupplier connectionFactoryConfiguration(Function<? super AgroalConnectionFactoryConfigurationSupplier, ? extends AgroalConnectionFactoryConfigurationSupplier> function) Modifies the configuration of the connection pool. -
connectionFactoryConfiguration
Allows access to the configuration builder for the connection pool. -
connectionCache
Sets the connection cache implementation. Default isLocalConnectionCache.single(). -
transactionIntegration
public AgroalConnectionPoolConfigurationSupplier transactionIntegration(TransactionIntegration integration) Sets the transaction integration instance to use. Default isTransactionIntegration.none(). -
transactionRequirement
public AgroalConnectionPoolConfigurationSupplier transactionRequirement(AgroalConnectionPoolConfiguration.TransactionRequirement requirement) Sets the transaction requirements for the pool. Default isAgroalConnectionPoolConfiguration.TransactionRequirement.OFF. -
enhancedLeakReport
Enables enhanced leak report. -
multipleAcquisition
public AgroalConnectionPoolConfigurationSupplier multipleAcquisition(AgroalConnectionPoolConfiguration.MultipleAcquisitionAction action) Sets the behaviour of the pool when a thread tries to acquire multiple connections. Default isAgroalConnectionPoolConfiguration.MultipleAcquisitionAction.OFF -
enhancedLeakReport
Enables or disables enhanced leak report. Default is false. -
flushOnClose
Enables flushing of connections on close. -
flushOnClose
Enables or disables flushing of connections on close. Default is false. -
initialSize
Sets the number of connections when the pool starts. Must not be negative. Default is zero. -
minSize
Sets the minimum number of connections on the pool. Must not be negative and smaller than max. Default is zero. -
maxSize
Sets the maximum number of connections on the pool. Must not be negative. Required. -
validateOnBorrow
Enables validation on borrow. Default is false. -
connectionValidator
public AgroalConnectionPoolConfigurationSupplier connectionValidator(AgroalConnectionPoolConfiguration.ConnectionValidator validator) Sets the connection validation method. DefaultAgroalConnectionPoolConfiguration.ConnectionValidator.emptyValidator() -
exceptionSorter
public AgroalConnectionPoolConfigurationSupplier exceptionSorter(AgroalConnectionPoolConfiguration.ExceptionSorter sorter) Sets the exception sorter. DefaultAgroalConnectionPoolConfiguration.ExceptionSorter.emptyExceptionSorter() -
acquisitionTimeout
Sets the duration of the acquisition timeout. Default isDuration.ZEROmeaning that a thread will wait indefinitely. -
idleValidationTimeout
Sets the duration of idle time for foreground validation to be executed. Default isDuration.ZEROmeaning that this feature is disabled. -
leakTimeout
Sets the duration of the leak timeout detection. Default isDuration.ZEROmeaning that this feature is disabled. -
validationTimeout
Sets the duration of background validation interval. Default isDuration.ZEROmeaning that this feature is disabled. -
reapTimeout
Sets the duration for eviction of idle connections. Default isDuration.ZEROmeaning that this feature is disabled. -
maxLifetime
Sets the duration for the lifetime of connections. Default isDuration.ZEROmeaning that this feature is disabled. -
get
- Specified by:
getin interfaceSupplier<AgroalConnectionPoolConfiguration>
-