Package io.quarkus.runtime
Annotation Type Shutdown
-
@Target(METHOD) @Retention(RUNTIME) public @interface Shutdown
This annotation is used to mark a business method of a CDI bean that should be executed during application shutdown. The annotated method must be non-private and non-static and declare no arguments.The behavior is similar to a declaration of a
ShutdownEventobserver. In fact, a synthetic observer of theShutdownEventis generated for each occurence of this annotation. Within the observer, the contextual instance of a bean is obtained first, and then the method is invoked.Furthermore,
value()can be used to specify the priority of the generated observer method and thus affects observers ordering.The contextual instance is destroyed immediately after the method is invoked for
Dependentbeans.The following examples are functionally equivalent.
@ApplicationScoped class Bean1 { void onShutdown(@Observes ShutdownEvent event) { // place the logic here } } @ApplicationScoped class Bean2 { @Shutdown void shutdown() { // place the logic here } }- See Also:
ShutdownEvent
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intvalue
-