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 voidafterCommit(T event) Handle the event after the contextual transaction is committed.default voidafterRollback(T event) Handle the event after the contextual transaction is rolled back.default voidbeforeCommit(T event) Handle an event before the contextual transaction is committed.default voidonApplicationEvent(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-
-