Interface TransactionalEventListener<T extends Event>
- All Superinterfaces:
org.springframework.context.ApplicationListener<T>
,EventListener<T>
,EventListener
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 TypeMethodDescriptiondefault void
afterCommit
(T event) Handle the event after the contextual transaction is committed.default void
afterRollback
(T event) 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
onApplicationEvent
(T event) Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Method Details
-
onApplicationEvent
-
beforeCommit
Handle an event before the contextual transaction is committed.- Parameters:
event
-
-
afterCommit
Handle the event after the contextual transaction is committed.- Parameters:
event
-
-
afterRollback
Handle the event after the contextual transaction is rolled back.- Parameters:
event
-
-