Package io.quarkus.runtime
Class ShutdownEvent
java.lang.Object
jakarta.enterprise.event.Shutdown
io.quarkus.runtime.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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enum
An enum with values reflecting the reason for application shutdown. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the application shutdown is considered standard; i.e.
-
Constructor Details
-
ShutdownEvent
public ShutdownEvent() -
ShutdownEvent
-
-
Method Details
-
isStandardShutdown
public boolean isStandardShutdown()Returnstrue
if 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(n
and so on. SendingCTRL + C
to running app in terminal is also non-standard shutdown.- Returns:
- true if the app shutdown was standard, false otherwise
-