use of io.quarkus.datasource.runtime.DataSourcesHealthSupport in project quarkus by quarkusio.
the class ReactiveMSSQLDataSourcesHealthCheck method init.
@PostConstruct
protected void init() {
ArcContainer container = Arc.container();
DataSourcesHealthSupport excluded = container.instance(DataSourcesHealthSupport.class).get();
Set<String> excludedNames = excluded.getExcludedNames();
for (InstanceHandle<MSSQLPool> handle : container.select(MSSQLPool.class, Any.Literal.INSTANCE).handles()) {
String poolName = getPoolName(handle.getBean());
if (!excludedNames.contains(poolName)) {
addPool(poolName, handle.get());
}
}
}
use of io.quarkus.datasource.runtime.DataSourcesHealthSupport in project quarkus by quarkusio.
the class DataSourceHealthCheck method init.
@PostConstruct
protected void init() {
DataSourcesHealthSupport support = Arc.container().instance(DataSourcesHealthSupport.class).get();
Set<String> names = support.getConfiguredNames();
Set<String> excludedNames = support.getExcludedNames();
for (String name : names) {
DataSource ds = DataSourceUtil.isDefault(name) ? (DataSource) Arc.container().instance(DataSource.class).get() : (DataSource) Arc.container().instance(DataSource.class, new DataSourceLiteral(name)).get();
if (!excludedNames.contains(name) && ds != null) {
dataSources.put(name, ds);
}
}
}
use of io.quarkus.datasource.runtime.DataSourcesHealthSupport in project quarkus by quarkusio.
the class ReactiveOracleDataSourcesHealthCheck method init.
@PostConstruct
protected void init() {
ArcContainer container = Arc.container();
DataSourcesHealthSupport excluded = container.instance(DataSourcesHealthSupport.class).get();
Set<String> excludedNames = excluded.getExcludedNames();
for (InstanceHandle<OraclePool> handle : container.select(OraclePool.class, Any.Literal.INSTANCE).handles()) {
String poolName = getPoolName(handle.getBean());
if (!excludedNames.contains(poolName)) {
addPool(poolName, handle.get());
}
}
}
use of io.quarkus.datasource.runtime.DataSourcesHealthSupport in project quarkus by quarkusio.
the class ReactivePgDataSourcesHealthCheck method init.
@PostConstruct
protected void init() {
ArcContainer container = Arc.container();
DataSourcesHealthSupport excluded = container.instance(DataSourcesHealthSupport.class).get();
Set<String> excludedNames = excluded.getExcludedNames();
for (InstanceHandle<PgPool> handle : container.select(PgPool.class, Any.Literal.INSTANCE).handles()) {
String poolName = getPoolName(handle.getBean());
if (!excludedNames.contains(poolName)) {
addPool(poolName, handle.get());
}
}
}
use of io.quarkus.datasource.runtime.DataSourcesHealthSupport in project quarkus by quarkusio.
the class ReactiveDB2DataSourcesHealthCheck method init.
@PostConstruct
protected void init() {
ArcContainer container = Arc.container();
DataSourcesHealthSupport excluded = container.instance(DataSourcesHealthSupport.class).get();
Set<String> excludedNames = excluded.getExcludedNames();
for (InstanceHandle<DB2Pool> handle : container.select(DB2Pool.class, Any.Literal.INSTANCE).handles()) {
String db2PoolName = getDB2PoolName(handle.getBean());
if (!excludedNames.contains(db2PoolName)) {
db2Pools.put(db2PoolName, handle.get());
}
}
}
Aggregations