Package io.quarkus.agroal.runtime
Class DataSources
java.lang.Object
io.quarkus.agroal.runtime.DataSources
Deprecated, for removal: This API element is subject to removal in a future version.
This class is sort of a producer for
AgroalDataSource.
It isn't a CDI producer in the literal sense, but it created a synthetic bean
from AgroalProcessor
The createDataSource method is called at runtime (see
)
in order to produce the actual invalid reference
AgroalRecorder#agroalDataSourceSupplier(String, DataSourcesRuntimeConfig)AgroalDataSource objects.
-
Constructor Summary
ConstructorsConstructorDescriptionDataSources(io.quarkus.datasource.runtime.DataSourcesBuildTimeConfig dataSourcesBuildTimeConfig, io.quarkus.datasource.runtime.DataSourcesRuntimeConfig dataSourcesRuntimeConfig, DataSourcesJdbcBuildTimeConfig dataSourcesJdbcBuildTimeConfig, DataSourcesJdbcRuntimeConfig dataSourcesJdbcRuntimeConfig, io.quarkus.narayana.jta.runtime.TransactionManagerConfiguration transactionRuntimeConfig, jakarta.transaction.TransactionManager transactionManager, org.jboss.tm.XAResourceRecoveryRegistry xaResourceRecoveryRegistry, jakarta.transaction.TransactionSynchronizationRegistry transactionSynchronizationRegistry, AgroalDataSourceSupport agroalDataSourceSupport, jakarta.enterprise.inject.Instance<io.agroal.api.AgroalPoolInterceptor> agroalPoolInterceptors, jakarta.enterprise.inject.Instance<AgroalOpenTelemetryWrapper> agroalOpenTelemetryWrapper) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionio.agroal.api.AgroalDataSourcecreateDataSource(String dataSourceName, boolean otelEnabled, Map<String, String> buildTimeJdbcProperties) Deprecated, for removal: This API element is subject to removal in a future version.static io.agroal.api.AgroalDataSourceDeprecated.UseAgroalDataSourceUtil.dataSourceInstance(String)instead.Deprecated.UseAgroalDataSourceUtil.activeDataSourceNames()instead.io.agroal.api.AgroalDataSourcegetDataSource(String dataSourceName) Deprecated.UseAgroalDataSourceUtil.dataSourceInstance(String)instead.booleanisDataSourceCreated(String dataSourceName) Deprecated.This shouldn't be needed.(package private) static io.agroal.api.configuration.AgroalConnectionPoolConfiguration.ConnectionValidatorsqlValidator(String sql, Duration queryTimeout, Duration networkTimeout) Deprecated, for removal: This API element is subject to removal in a future version.A validator that uses the provided SQL statement for validation with a query timeout and a configurable network timeout.
-
Constructor Details
-
DataSources
public DataSources(io.quarkus.datasource.runtime.DataSourcesBuildTimeConfig dataSourcesBuildTimeConfig, io.quarkus.datasource.runtime.DataSourcesRuntimeConfig dataSourcesRuntimeConfig, DataSourcesJdbcBuildTimeConfig dataSourcesJdbcBuildTimeConfig, DataSourcesJdbcRuntimeConfig dataSourcesJdbcRuntimeConfig, io.quarkus.narayana.jta.runtime.TransactionManagerConfiguration transactionRuntimeConfig, jakarta.transaction.TransactionManager transactionManager, org.jboss.tm.XAResourceRecoveryRegistry xaResourceRecoveryRegistry, jakarta.transaction.TransactionSynchronizationRegistry transactionSynchronizationRegistry, AgroalDataSourceSupport agroalDataSourceSupport, @Any jakarta.enterprise.inject.Instance<io.agroal.api.AgroalPoolInterceptor> agroalPoolInterceptors, jakarta.enterprise.inject.Instance<AgroalOpenTelemetryWrapper> agroalOpenTelemetryWrapper) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
fromName
Deprecated.UseAgroalDataSourceUtil.dataSourceInstance(String)instead. This method should not be used as it can very easily lead to timing issues during bean creation.Meant to be used from recorders that create synthetic beans that need access toDatasource. In such usingArc.container.instance(DataSource.class)is not possible becauseDatasourceis itself a synthetic bean.This method relies on the fact that
DataSourcesshould - given the same input - always return the sameAgroalDataSourceno matter how many times it is invoked (which makes sense becauseDataSourceis aSingletonbean).This method is thread-safe
-
isDataSourceCreated
Deprecated.This shouldn't be needed. UseAgroalDataSourceUtil.dataSourceIfActive(String)to check if a datasource is active. -
getActiveDataSourceNames
Deprecated.UseAgroalDataSourceUtil.activeDataSourceNames()instead. -
getDataSource
Deprecated.UseAgroalDataSourceUtil.dataSourceInstance(String)instead. -
createDataSource
public io.agroal.api.AgroalDataSource createDataSource(String dataSourceName, boolean otelEnabled, Map<String, String> buildTimeJdbcProperties) Deprecated, for removal: This API element is subject to removal in a future version. -
sqlValidator
static io.agroal.api.configuration.AgroalConnectionPoolConfiguration.ConnectionValidator sqlValidator(String sql, Duration queryTimeout, Duration networkTimeout) Deprecated, for removal: This API element is subject to removal in a future version.A validator that uses the provided SQL statement for validation with a query timeout and a configurable network timeout. If the timeout period expires before the operation completes, the connection is invalidated. A timeout of zero means no timeout. The network timeout should be greater than the query timeout to allow the query timeout to cancel the statement cleanly before the network timeout forces the socket closed.
-
AgroalDataSourceUtilinstead.