From 98bcf7f0c2fce60d38b579532f6e6ce638a3c997 Mon Sep 17 00:00:00 2001 From: Prashanth G Date: Mon, 7 Jun 2021 09:56:14 -0400 Subject: [PATCH] Updated CDI Integration section to add Startup in README Signed-off-by: Prashanth G --- README.adoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 9e975b2..46715c1 100644 --- a/README.adoc +++ b/README.adoc @@ -1,5 +1,5 @@ // -// Copyright (c) 2016-2020 Contributors to the Eclipse Foundation +// Copyright (c) 2016-2021 Contributors to the Eclipse Foundation // // See the NOTICES file(s) distributed with this work for additional // information regarding copyright ownership. @@ -118,7 +118,7 @@ The _@Startup_ annotation must be applied on a _HealthCheck_ implementation to d == Integration with CDI -Any enabled bean with a bean of type _org.eclipse.microprofile.health.HealthCheck_ and _@Liveness_ or _@Readiness_ qualifier can be used as health check procedure. +Any enabled bean with a bean of type _org.eclipse.microprofile.health.HealthCheck_ and _@Liveness_, _@Readiness_, or _@Startup_ qualifier can be used as health check procedure. Contextual references of health check procedures are invoked by runtime when the outermost protocol entry point (i.e. _http://HOST:PORT/health_) receives an inbound request @@ -154,6 +154,12 @@ class MyChecks { HealthCheck check2() { return () -> HealthCheckResponse.named("cpu-usage").status(getCpuUsage() < 0.9).build(); } + + @Produces + @Startup + HealthCheck check3() { + return () -> HealthCheckResponse.named("initial-heap-memory").status(getMemUsage() < 0.95).build(); + } } ```