Search in sources :

Example 1 with GracefulShutdownCallback

use of org.springframework.boot.web.server.GracefulShutdownCallback in project spring-boot by spring-projects.

the class UndertowWebServer method notifyGracefulCallback.

private void notifyGracefulCallback(boolean success) {
    GracefulShutdownCallback callback = this.gracefulShutdownCallback.getAndSet(null);
    if (callback != null) {
        if (success) {
            logger.info("Graceful shutdown complete");
            callback.shutdownComplete(GracefulShutdownResult.IDLE);
        } else {
            logger.info("Graceful shutdown aborted with one or more requests still active");
            callback.shutdownComplete(GracefulShutdownResult.REQUESTS_ACTIVE);
        }
    }
}
Also used : GracefulShutdownCallback(org.springframework.boot.web.server.GracefulShutdownCallback)

Aggregations

GracefulShutdownCallback (org.springframework.boot.web.server.GracefulShutdownCallback)1