void stop()

in geronimo-health/src/main/java/org/apache/geronimo/microprofile/impl/health/cdi/GeronimoHealthExtension.java [91:106]


    void stop(@Observes final BeforeShutdown beforeShutdown) {
        final IllegalStateException ise = new IllegalStateException("Something went wrong releasing health checks");
        contexts.forEach(c -> {
            try {
                c.release();
            } catch (final RuntimeException re) {
                ise.addSuppressed(re);
            }
        });
        final Throwable[] suppressed = ise.getSuppressed();
        if (suppressed.length == 1) {
            throw RuntimeException.class.cast(suppressed[0]);
        } else if (suppressed.length > 1) {
            throw ise;
        }
    }