private void afterDeploymentValidation(@Observes final AfterDeploymentValidation avd, BeanManager bm) {
        for (AnnotatedType delegate : delegates) {
            try {
                Unmanaged<HealthCheck> unmanagedHealthCheck = new Unmanaged<HealthCheck>(bm, delegate.getJavaClass());
                UnmanagedInstance<HealthCheck> healthCheckInstance = unmanagedHealthCheck.newInstance();
                HealthCheck healthCheck =  healthCheckInstance.produce().inject().postConstruct().get();
                healthCheckInstances.add(healthCheckInstance);
                healthReporter.addHealthCheck(healthCheck);
            } catch (Exception e) {
                throw new RuntimeException("Failed to register health bean", e);
            }
        }
    }
private void afterDeploymentValidation(@Observes final AfterDeploymentValidation avd, BeanManager bm) {
        for (AnnotatedType delegate : delegates) {
            try {
                Unmanaged<HealthCheck> unmanagedHealthCheck = new Unmanaged<HealthCheck>(bm, delegate.getJavaClass());
                UnmanagedInstance<HealthCheck> healthCheckInstance = unmanagedHealthCheck.newInstance();
                HealthCheck healthCheck =  healthCheckInstance.produce().inject().postConstruct().get();
                healthCheckInstances.add(healthCheckInstance);
                healthReporter.addHealthCheck(healthCheck);
            } catch (Exception e) {
                throw new RuntimeException("Failed to register health bean", e);
            }
        }
    }
private void afterDeploymentValidation ( @ Observes final AfterDeploymentValidation avd , BeanManager bm ) { for ( AnnotatedType delegate : delegates ) { try { Unmanaged < HealthCheck > unmanagedHealthCheck = new Unmanaged < HealthCheck > ( bm , delegate . getJavaClass ( ) ) ; UnmanagedInstance < HealthCheck > healthCheckInstance = unmanagedHealthCheck . newInstance ( ) ; HealthCheck healthCheck = healthCheckInstance . produce ( ) . inject ( ) . postConstruct ( ) . get ( ) ; healthCheckInstances . add ( healthCheckInstance ) ; healthReporter . addHealthCheck ( healthCheck ) ; } catch ( Exception e ) { throw new RuntimeException ( "Failed to register health bean" , e ) ; } } }
Instantiates <em>unmanaged instances</em> of HealthCheckProcedure and
handle manually their CDI creation lifecycle.
Add them to the {@link SmallRyeHealthReporter}.
Instantiates <em > unmanaged instances< / em > of HealthCheckProcedure and handle manually their CDI creation lifecycle . Add them to the {