Class DefaultHealthCheckService

    • Constructor Detail

      • DefaultHealthCheckService

        public DefaultHealthCheckService​(org.osgi.framework.BundleContext bundleContext)
    • Method Detail

      • getHealthChecks

        protected java.util.List<HealthCheck> getHealthChecks()
                                                       throws org.osgi.framework.InvalidSyntaxException
        Throws:
        org.osgi.framework.InvalidSyntaxException
      • performAsyncHealthCheck

        public io.vavr.control.Either<java.lang.String,​java.util.concurrent.CompletionStage<Health>> performAsyncHealthCheck​(Context context,
                                                                                                                                   HealthCheckService.ProgressListener listener,
                                                                                                                                   java.util.List<java.lang.String> tags)
        Description copied from interface: HealthCheckService
        Performs various HealthChecks asynchronously and returns a CompletableFuture which contains the Health representing each HealthChecks Response. It is up to the implementation to respect timeouts and handle exceptions accordingly, when these situations arise when calling HealthCheck.perform(Context). Callback methods can be provided to print information before and after a HealthCheck is invoked. When providing a onFinishConsumer please note, that this is invoked even if the HealthCheck.perform(Context) execution failed or timed out and therefore may not represent the value when calling HealthCheck.perform(Context) directly.
        Specified by:
        performAsyncHealthCheck in interface HealthCheckService
        Parameters:
        context - The context object
        listener - gets informed about health check progress. May be null. In case the Either contains an error no listener callbacks are called at all. If the Either contains a all listener callbacks are guaranteed to be called before that completion stage completes.
        tags - selects the single health checks that are included in the overall check; every health check that has any of the given tags is included.
        Returns:
        Either an error message if no matching health checks could be determined or a CompletableFuture to retrieve the Health from.