-
- All Superinterfaces:
Scope
public interface TransactionContext extends Scope
A context object that is used to pass arguments to the various methods ofTransactionProvider.- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable Exceptioncause()The exception that has caused the rollback.@NotNull TransactionContextcause(Exception cause)Set the exception that has caused the rollback to the current transaction context.@Nullable ThrowablecauseThrowable()The throwable that has caused the rollback.@NotNull TransactionContextcauseThrowable(Throwable cause)Set the throwable that has caused the rollback to the current transaction context.@Nullable Transactiontransaction()A user-defined transaction object, possibly obtained fromTransactionProvider.begin(TransactionContext).@NotNull TransactionContexttransaction(Transaction transaction)Set the user-defined transaction object to the current transaction context.
-
-
-
Method Detail
-
transaction
@Nullable @Nullable Transaction transaction()
A user-defined transaction object, possibly obtained fromTransactionProvider.begin(TransactionContext).- Returns:
- The transaction object. May be
null.
-
transaction
@NotNull @NotNull TransactionContext transaction(Transaction transaction)
Set the user-defined transaction object to the current transaction context.
-
cause
@Nullable @Nullable Exception cause()
The exception that has caused the rollback.- Returns:
- The exception. May be
null, in particular if the cause is aThrowable, in case of whichcauseThrowable()should be called.
-
causeThrowable
@Nullable @Nullable Throwable causeThrowable()
The throwable that has caused the rollback.- Returns:
- The throwable. May be
null.
-
cause
@NotNull @NotNull TransactionContext cause(Exception cause)
Set the exception that has caused the rollback to the current transaction context.
-
causeThrowable
@NotNull @NotNull TransactionContext causeThrowable(Throwable cause)
Set the throwable that has caused the rollback to the current transaction context.
-
-