Interface TransactionalEventListener<T extends Event>

All Superinterfaces:
org.springframework.context.ApplicationListener<T>, EventListener<T>, EventListener

public interface TransactionalEventListener<T extends Event> extends EventListener<T>
An EventListener bound to a phase of the current transaction. This listener should be used when an event is posted during a transaction, and the corresponding handler should be executed before the commit, after the commit or after the rollback.
Author:
Manuel Fiorelli
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    afterCommit(T event)
    Handle the event after the contextual transaction is committed.
    default void
    Handle the event after the contextual transaction is rolled back.
    default void
    beforeCommit(T event)
    Handle an event before the contextual transaction is committed.
    default void
     

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution
  • Method Details

    • onApplicationEvent

      default void onApplicationEvent(T event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<T extends Event>
    • beforeCommit

      default void beforeCommit(T event)
      Handle an event before the contextual transaction is committed.
      Parameters:
      event -
    • afterCommit

      default void afterCommit(T event)
      Handle the event after the contextual transaction is committed.
      Parameters:
      event -
    • afterRollback

      default void afterRollback(T event)
      Handle the event after the contextual transaction is rolled back.
      Parameters:
      event -