Package io.micronaut.transaction
Interface TransactionCallback<T,R>
-
- Type Parameters:
T
- The connection typeR
- The return type
- All Superinterfaces:
java.util.function.Function<TransactionStatus<T>,R>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface TransactionCallback<T,R> extends java.util.function.Function<TransactionStatus<T>,R>
A functional interface for running code that runs within the context of a transaction.- Author:
- graemerocher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default R
apply(TransactionStatus<T> status)
R
call(TransactionStatus<T> status)
Code that runs within the context of a transaction will implement this method.
-
-
-
Method Detail
-
apply
default R apply(TransactionStatus<T> status)
-
call
@Nullable R call(@NonNull TransactionStatus<T> status) throws java.lang.Exception
Code that runs within the context of a transaction will implement this method.- Parameters:
status
- The transaction status.- Returns:
- The return value
- Throws:
java.lang.Exception
- When an error occurs in invoking the transaction
-
-