java.lang.Object
org.jooq.impl.CallbackTransactionListener
- All Implemented Interfaces:
TransactionListener
A
TransactionListener that allows for functional composition.
For example:
TransactionListener listener = TransactionListener
.onCommitStart(ctx -> something())
.onCommitEnd(ctx -> something());
- Author:
- Lukas Eder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidCalled afterTransactionProvider.begin(TransactionContext).final voidCalled beforeTransactionProvider.begin(TransactionContext).final voidCalled afterTransactionProvider.commit(TransactionContext).final voidCalled beforeTransactionProvider.commit(TransactionContext).onBeginEnd(Consumer<? super TransactionContext> newOnBeginEnd) onBeginStart(Consumer<? super TransactionContext> newOnBeginStart) onCommitEnd(Consumer<? super TransactionContext> newOnCommitEnd) onCommitStart(Consumer<? super TransactionContext> newOnCommitStart) onRollbackEnd(Consumer<? super TransactionContext> newOnRollbackEnd) onRollbackStart(Consumer<? super TransactionContext> newOnRollbackStart) final voidCalled afterTransactionProvider.rollback(TransactionContext).final voidCalled beforeTransactionProvider.rollback(TransactionContext).
-
Constructor Details
-
CallbackTransactionListener
public CallbackTransactionListener()
-
-
Method Details
-
beginStart
Description copied from interface:TransactionListenerCalled beforeTransactionProvider.begin(TransactionContext).- Specified by:
beginStartin interfaceTransactionListener- Parameters:
ctx- The context containing information about the transaction.
-
beginEnd
Description copied from interface:TransactionListenerCalled afterTransactionProvider.begin(TransactionContext).- Specified by:
beginEndin interfaceTransactionListener- Parameters:
ctx- The context containing information about the transaction.
-
commitStart
Description copied from interface:TransactionListenerCalled beforeTransactionProvider.commit(TransactionContext).- Specified by:
commitStartin interfaceTransactionListener- Parameters:
ctx- The context containing information about the transaction.
-
commitEnd
Description copied from interface:TransactionListenerCalled afterTransactionProvider.commit(TransactionContext).- Specified by:
commitEndin interfaceTransactionListener- Parameters:
ctx- The context containing information about the transaction.
-
rollbackStart
Description copied from interface:TransactionListenerCalled beforeTransactionProvider.rollback(TransactionContext).- Specified by:
rollbackStartin interfaceTransactionListener- Parameters:
ctx- The context containing information about the transaction.
-
rollbackEnd
Description copied from interface:TransactionListenerCalled afterTransactionProvider.rollback(TransactionContext).- Specified by:
rollbackEndin interfaceTransactionListener- Parameters:
ctx- The context containing information about the transaction.
-
onBeginStart
public final CallbackTransactionListener onBeginStart(Consumer<? super TransactionContext> newOnBeginStart) -
onBeginEnd
public final CallbackTransactionListener onBeginEnd(Consumer<? super TransactionContext> newOnBeginEnd) -
onCommitStart
public final CallbackTransactionListener onCommitStart(Consumer<? super TransactionContext> newOnCommitStart) -
onCommitEnd
public final CallbackTransactionListener onCommitEnd(Consumer<? super TransactionContext> newOnCommitEnd) -
onRollbackStart
public final CallbackTransactionListener onRollbackStart(Consumer<? super TransactionContext> newOnRollbackStart) -
onRollbackEnd
public final CallbackTransactionListener onRollbackEnd(Consumer<? super TransactionContext> newOnRollbackEnd)
-