From 02835df37c55d2d82a78b3492ec8ccf14a12e58c Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Sun, 4 Aug 2024 16:22:59 -0600 Subject: [PATCH] fix: more javadoc Signed-off-by: Matt Peterson --- .../block/server/ServiceStatusImpl.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/server/src/main/java/com/hedera/block/server/ServiceStatusImpl.java b/server/src/main/java/com/hedera/block/server/ServiceStatusImpl.java index 0d4429317..17c178810 100644 --- a/server/src/main/java/com/hedera/block/server/ServiceStatusImpl.java +++ b/server/src/main/java/com/hedera/block/server/ServiceStatusImpl.java @@ -19,22 +19,46 @@ import io.helidon.webserver.WebServer; import java.util.concurrent.atomic.AtomicBoolean; +/** + * The ServiceStatusImpl class implements the ServiceStatus interface. + * It provides the implementation for checking the status of the service and + * shutting down the web server. + */ public class ServiceStatusImpl implements ServiceStatus { private final AtomicBoolean isRunning = new AtomicBoolean(true); private WebServer webServer; + /** + * Checks if the service is running. + * + * @return true if the service is running, false otherwise + */ public boolean isRunning() { return isRunning.get(); } + /** + * Sets the running status of the service. + * + * @param running true if the service is running, false otherwise + */ public void setRunning(final boolean running) { isRunning.set(running); } + /** + * Sets the web server instance. + * + * @param webServer the web server instance + */ public void setWebServer(final WebServer webServer) { this.webServer = webServer; } + /** + * Stops the service and web server. This method is called to shut down the service and the web + * server in the event of an unrecoverable exception or during expected maintenance. + */ public void stopWebServer() { isRunning.set(false); webServer.stop();