Skip to content

Commit

Permalink
fix: more javadoc
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Aug 4, 2024
1 parent 71ed006 commit 02835df
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 02835df

Please sign in to comment.