Annotation Interface ShutdownDelayInitiated


@Target(METHOD) @Retention(RUNTIME) public @interface ShutdownDelayInitiated
This annotation is used to mark a business method of a CDI bean that should be executed when the shutdown delay starts. The annotated method must be non-private and non-static and declare no arguments. Furthermore, quarkus.shutdown.delay-enabled must be set to true.

The behavior is similar to a declaration of a ShutdownDelayInitiatedEvent observer. In fact, a synthetic observer of the ShutdownDelayInitiatedEvent is generated for each occurrence 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 Dependent beans.

The following examples are functionally equivalent.

 @ApplicationScoped
 class Bean1 {
     void onShutdown(@Observes ShutdownDelayInitiatedEvent event) {
         // place the logic here
     }
 }

 @ApplicationScoped
 class Bean2 {

     @ShutdownDelayInitiated
     void shutdown() {
         // place the logic here
     }
 }
 
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
     
  • Element Details

    • value

      int value
      Returns:
      the priority
      See Also:
      • Priority
      Default:
      2500