Class DataSourceSupport

java.lang.Object
io.quarkus.datasource.runtime.DataSourceSupport

public class DataSourceSupport extends Object
Helper class that holds the names of all configured data sources, along with the names of those that are inactive or excluded from health checks.

This is used by any feature that needs runtime access to data sources, e.g. Flyway/Liquibase or health check implementation classes.

  • Constructor Details

    • DataSourceSupport

      public DataSourceSupport(Set<String> healthCheckExcludedNames, Set<String> inactiveNames)
  • Method Details

    • getInactiveNames

      @Deprecated public Set<String> getInactiveNames()
      Deprecated.
      This may not account for datasources deactivated automatically (due to missing configuration, ...). To check if a datasource bean is active, use Arc.container().select(...).getHandle().getBean().isActive(). Alternatively, to check if a datasource is active, use the utils AgroalDataSourceUtil#dataSourceIfActive(...)/AgroalDataSourceUtil#activeDataSourceNames() or ReactiveDataSourceUtil#dataSourceIfActive(...)/ReactiveDataSourceUtil#activeDataSourceNames().
    • getInactiveOrHealthCheckExcludedNames

      @Deprecated public Set<String> getInactiveOrHealthCheckExcludedNames()
      Deprecated.
      This may not account for datasources deactivated automatically (due to missing configuration, ...). To check if a datasource is excluded from health checks, use getHealthCheckExcludedNames(). To check if a datasource bean is active, use Arc.container().select(...).getHandle().getBean().isActive(). Alternatively, to check if a datasource is active, use the utils AgroalDataSourceUtil#dataSourceIfActive(...)/AgroalDataSourceUtil#activeDataSourceNames() or ReactiveDataSourceUtil#dataSourceIfActive(...)/ReactiveDataSourceUtil#activeDataSourceNames().
    • getHealthCheckExcludedNames

      public Set<String> getHealthCheckExcludedNames()