Skip to content
Permalink
Browse files
GERONIMO-6758 ensure multiple health checks work (mp-health 2.1)
  • Loading branch information
rmannibucau committed Dec 31, 2019
1 parent e6f456d commit 41f8f23065feb972de06199dd17af77963c760a3
Showing 2 changed files with 12 additions and 8 deletions.
@@ -21,11 +21,11 @@
<parent>
<artifactId>geronimo-health-parent</artifactId>
<groupId>org.apache.geronimo</groupId>
<version>1.0.3-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>geronimo-health</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<name>Geronimo Health :: Microprofile</name>

<properties>
@@ -132,12 +132,16 @@ public boolean isReady() {

private HealthCheck lookup(final Bean<?> bean, final BeanManager manager) {
// if this is not an instance of HealthCheck, then it's a producer (not sure it's enough)
final Class<?> type = bean.getBeanClass() == null || !HealthCheck.class.isAssignableFrom(bean.getBeanClass())
? HealthCheck.class
: bean.getBeanClass();
final Set<Annotation> qualifiers = bean.getQualifiers();
final Set<Bean<?>> beans = manager.getBeans(type, qualifiers.toArray(new Annotation[qualifiers.size()]));
final Bean<?> resolvedBean = manager.resolve(beans);
final Class<?> type = bean.getBeanClass() == null ?
HealthCheck.class :
(bean.getTypes().contains(bean.getBeanClass()) ? bean.getBeanClass() : HealthCheck.class);
final Bean<?> resolvedBean;
if (type != HealthCheck.class) {
final Set<Bean<?>> beans = manager.getBeans(type, bean.getQualifiers().toArray(new Annotation[0]));
resolvedBean = manager.resolve(beans);
} else {
resolvedBean = bean;
}
final CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
if (!manager.isNormalScope(resolvedBean.getScope())) {
contexts.add(creationalContext);

0 comments on commit 41f8f23

Please sign in to comment.