Package io.agroal.api.configuration
Interface AgroalConnectionPoolConfiguration
-
public interface AgroalConnectionPoolConfigurationThe configuration of the connection pool.- Author:
- Luis Barreiro
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAgroalConnectionPoolConfiguration.ConnectionValidatorInterface for custom connection validation strategies.static interfaceAgroalConnectionPoolConfiguration.ExceptionSorterInterface for custom exception sorter strategies.static classAgroalConnectionPoolConfiguration.MultipleAcquisitionActionAction to perform on acquisition of multiple connections by the same thread.static classAgroalConnectionPoolConfiguration.TransactionRequirementModes available for transaction requirement.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DurationacquisitionTimeout()The maximum amount of time a thread may be blocked waiting for a connection.ConnectionCacheconnectionCache()Customizable strategy for connection caching.AgroalConnectionFactoryConfigurationconnectionFactoryConfiguration()Configuration for the connection factory.AgroalConnectionPoolConfiguration.ConnectionValidatorconnectionValidator()The connection validation method.booleanenhancedLeakReport()Provides detailed insights of the connection status when it's reported as a leak (as INFO messages on AgroalDataSourceListener).AgroalConnectionPoolConfiguration.ExceptionSorterexceptionSorter()Allows a custom exception sorter.booleanflushOnClose()If connections should be flushed when returning to the pool.DurationidleValidationTimeout()Connections idle for longer than this time period are validated before being acquired (foreground validation).intinitialSize()The number of connections to be created when the pool starts.DurationleakTimeout()Connections acquired for longer than this time period may be reported as leaking.DurationmaxLifetime()Connections that are older than this time period are flushed from the pool.intmaxSize()The maximum number of connections on the pool.intminSize()The minimum number of connections on the pool.AgroalConnectionPoolConfiguration.MultipleAcquisitionActionmultipleAcquisition()Behaviour when a thread tries to acquire multiple connections.DurationreapTimeout()Connections idle for longer than this time period are flushed from the pool.voidsetAcquisitionTimeout(Duration timeout)Sets a new amount of time a thread may be blocked.voidsetMaxSize(int size)Sets a new maximum number of connections on the pool.voidsetMinSize(int size)Sets a new minimum number of connections on the pool.TransactionIntegrationtransactionIntegration()The transaction layer integration to use.AgroalConnectionPoolConfiguration.TransactionRequirementtransactionRequirement()Requires connections to be enlisted into a transaction.DurationvalidationTimeout()Connections idle for longer than this time period are validated (background validation).
-
-
-
Method Detail
-
connectionFactoryConfiguration
AgroalConnectionFactoryConfiguration connectionFactoryConfiguration()
Configuration for the connection factory.
-
connectionValidator
AgroalConnectionPoolConfiguration.ConnectionValidator connectionValidator()
The connection validation method. Allows customization of the validation operation.
-
exceptionSorter
AgroalConnectionPoolConfiguration.ExceptionSorter exceptionSorter()
Allows a custom exception sorter. This determines if a connection is still usable after an exception.
-
connectionCache
ConnectionCache connectionCache()
Customizable strategy for connection caching.
-
transactionIntegration
TransactionIntegration transactionIntegration()
The transaction layer integration to use.
-
transactionRequirement
AgroalConnectionPoolConfiguration.TransactionRequirement transactionRequirement()
Requires connections to be enlisted into a transaction.
-
idleValidationTimeout
Duration idleValidationTimeout()
Connections idle for longer than this time period are validated before being acquired (foreground validation). A duration ofDuration.ZEROmeans that a this feature is disabled.
-
leakTimeout
Duration leakTimeout()
Connections acquired for longer than this time period may be reported as leaking. A duration ofDuration.ZEROmeans that a this feature is disabled.
-
validationTimeout
Duration validationTimeout()
Connections idle for longer than this time period are validated (background validation). A duration ofDuration.ZEROmeans that a this feature is disabled.
-
reapTimeout
Duration reapTimeout()
Connections idle for longer than this time period are flushed from the pool. A duration ofDuration.ZEROmeans that a this feature is disabled.
-
maxLifetime
Duration maxLifetime()
Connections that are older than this time period are flushed from the pool. A duration ofDuration.ZEROmeans that a this feature is disabled.
-
enhancedLeakReport
boolean enhancedLeakReport()
Provides detailed insights of the connection status when it's reported as a leak (as INFO messages on AgroalDataSourceListener).
-
flushOnClose
boolean flushOnClose()
If connections should be flushed when returning to the pool.
-
multipleAcquisition
AgroalConnectionPoolConfiguration.MultipleAcquisitionAction multipleAcquisition()
Behaviour when a thread tries to acquire multiple connections.
-
initialSize
int initialSize()
The number of connections to be created when the pool starts. Can be smaller than min or bigger than max.
-
minSize
int minSize()
The minimum number of connections on the pool. If the pool has to flush connections it may create connections to keep this amount.
-
setMinSize
void setMinSize(int size)
Sets a new minimum number of connections on the pool. When this value increase the pool may temporarily have less connections than the minimum.
-
maxSize
int maxSize()
The maximum number of connections on the pool. When the number of acquired connections is equal to this value, further requests will block.
-
setMaxSize
void setMaxSize(int size)
Sets a new maximum number of connections on the pool. When this value decreases the pool may temporarily have more connections than the maximum.
-
acquisitionTimeout
Duration acquisitionTimeout()
The maximum amount of time a thread may be blocked waiting for a connection. If this time expires and still no connection is available, an exception is thrown. A duration ofDuration.ZEROmeans that a thread will wait indefinitely. In Pool-less this timeout can add toAgroalConnectionFactoryConfiguration.loginTimeout().
-
setAcquisitionTimeout
void setAcquisitionTimeout(Duration timeout)
Sets a new amount of time a thread may be blocked. Threads already blocked when this value changes do not see the new value when they unblock. A duration ofDuration.ZEROmeans that a thread will wait indefinitely.
-
-