Package io.quarkus.runtime
Class ShutdownEvent
- java.lang.Object
-
- io.quarkus.runtime.ShutdownEvent
-
public class ShutdownEvent extends Object
Event that is fired before shutdown and can be inspected for shutdown cause. SeeisStandardShutdown()This event is observed as follows:The annotated method can access other injected beans.void onStop(@Observes ShutdownEvent ev) { LOGGER.info("The application is stopping..."); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classShutdownEvent.ShutdownReasonAn enum with values reflecting the reason for application shutdown.
-
Constructor Summary
Constructors Constructor Description ShutdownEvent()ShutdownEvent(ShutdownEvent.ShutdownReason shutdownReason)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisStandardShutdown()Returnstrueif the application shutdown is considered standard; i.e.
-
-
-
Constructor Detail
-
ShutdownEvent
public ShutdownEvent()
-
ShutdownEvent
public ShutdownEvent(ShutdownEvent.ShutdownReason shutdownReason)
-
-
Method Detail
-
isStandardShutdown
public boolean isStandardShutdown()
Returnstrueif the application shutdown is considered standard; i.e. by exitingmain()method or executing eitherQuarkus.asyncExit()orQuarkus.blockingExit().All other cases are non-standard -
SIGINT,SIGTERM,System.exit(nand so on. SendingCTRL + Cto running app in terminal is also non-standard shutdown.- Returns:
- true if the app shutdown was standard, false otherwise
-
-