All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.castled.AppShutdownHandler Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package io.castled;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import io.castled.jarvis.taskmanager.JarvisTasksClient;
import lombok.Getter;

@Singleton
public class AppShutdownHandler {

    private final JarvisTasksClient jarvisTasksClient;

    @Getter
    private volatile boolean shutdownTriggered;

    @Inject
    private AppShutdownHandler(JarvisTasksClient jarvisTasksClient) {
        this.jarvisTasksClient = jarvisTasksClient;
    }

    public void handleShutdown() {
        shutdownTriggered = true;
        this.jarvisTasksClient.close();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy