Class ShutdownEvent


  • public class ShutdownEvent
    extends jakarta.enterprise.event.Shutdown
    Event that is fired before shutdown and can be inspected for shutdown cause. See isStandardShutdown() This event is observed as follows:
         void onStop(@Observes ShutdownEvent ev) {
             LOGGER.info("The application is stopping...");
         }
     
    The annotated method can access other injected beans.
    • Method Detail

      • isStandardShutdown

        public boolean isStandardShutdown()
        Returns true if the application shutdown is considered standard; i.e. by exiting main() method or executing either Quarkus.asyncExit() or Quarkus.blockingExit().

        All other cases are non-standard - SIGINT, SIGTERM, System.exit(n and so on. Sending CTRL + C to running app in terminal is also non-standard shutdown.

        Returns:
        true if the app shutdown was standard, false otherwise