Package org.axonframework.lifecycle
Annotation Interface ShutdownHandler
@Documented
@Retention(RUNTIME)
@Target({ANNOTATION_TYPE,METHOD})
@HasHandlerAttributes
public @interface ShutdownHandler
Annotation indicating that a member method should be a part of the shutdown cycle of an Axon application. The
operation can be made asynchronous by defining a return type of
CompletableFuture on the
annotated method.
The phase() defines the moment the member method should be invoked. The higher the provided phase,
the earlier this method will be executed during shutdown.
This annotation is only allowed on methods and as a meta-annotation.
- Since:
- 4.3
- Author:
- Steven van Beelen
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionintAnintdefining the moment in the shutdown cycle the member method should be invoked.
-
Element Details
-
phase
int phaseAnintdefining the moment in the shutdown cycle the member method should be invoked. The higher the providedphase, the earlier this method will be executed during shutdown. ThePhaseconstants can be used to this end.- Returns:
- the
intdefining the moment in the shutdown cycle the member method should be invoked
-