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(DataSourcesBuildTimeConfig dataSourcesBuildTimeConfig, DataSourcesRuntimeConfig dataSourcesRuntimeConfig, DataSourcesJdbcBuildTimeConfig dataSourcesJdbcBuildTimeConfig, DataSourcesJdbcRuntimeConfig dataSourcesJdbcRuntimeConfig, 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) 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.
-
Constructor Details
-
DataSources
public DataSources(DataSourcesBuildTimeConfig dataSourcesBuildTimeConfig, DataSourcesRuntimeConfig dataSourcesRuntimeConfig, DataSourcesJdbcBuildTimeConfig dataSourcesJdbcBuildTimeConfig, DataSourcesJdbcRuntimeConfig dataSourcesJdbcRuntimeConfig, 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
Deprecated, for removal: This API element is subject to removal in a future version.
-
AgroalDataSourceUtilinstead.