Enum Class CompletionTiming

java.lang.Object
java.lang.Enum<CompletionTiming>
org.springframework.modulith.events.support.CompletionTiming
All Implemented Interfaces:
Serializable, Comparable<CompletionTiming>, Constable

public enum CompletionTiming extends Enum<CompletionTiming>
Defines when the completion of an event publication takes place relative to the transactional event listener.
Since:
2.2
Author:
Oliver Drotbohm
  • Enum Constant Details

    • IN_LISTENER

      public static final CompletionTiming IN_LISTENER
      Completes the event publication within the listener's transaction, right before it commits. Completion is atomic with the listener's work. This is the default behavior.
    • IN_INTERCEPTOR

      public static final CompletionTiming IN_INTERCEPTOR
      Completes the event publication in a transaction of its own after the listener (and its transaction) has finished.
  • Field Details

  • Method Details

    • values

      public static CompletionTiming[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CompletionTiming valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • from

      public static CompletionTiming from(Environment environment)
      Looks up the CompletionTiming from the given environment or uses IN_LISTENER as default.
      Parameters:
      environment - must not be null.
      Returns:
      will never be null.