java.lang.Object
io.helidon.transaction.Tx
Annotations and types related to transactional method execution.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceAnnotated method will be executed with managed transaction ofTx.Type.MANDATORYtype.static @interfaceAnnotated method will be executed with managed transaction ofTx.Type.NEVERtype.static @interfaceAnnotated method will be executed with managed transaction ofTx.Type.NEWtype.static @interfaceAnnotated method will be executed with managed transaction ofTx.Type.REQUIREDtype.static @interfaceAnnotated method will be executed with managed transaction ofTx.Type.SUPPORTEDtype.static @interfaceTransactionTx.Typeannotation.static enumTransaction type.static @interfaceAnnotated method will be executed with managed transaction ofTx.Type.UNSUPPORTEDtype. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidExecute providedtaskwith managed transaction ofTx.Type.REQUIREDtype.static voidtransaction(Tx.Type type, Functions.CheckedRunnable<Exception> task) Execute providedtaskwith managed transaction of providedtype.static <T> Ttransaction(Tx.Type type, Callable<T> task) Execute providedtaskwith managed transaction of providedtype.static <T> Ttransaction(Callable<T> task) Execute providedtaskwith managed transaction ofTx.Type.REQUIREDtype.
-
Method Details
-
transaction
Execute providedtaskwith managed transaction ofTx.Type.REQUIREDtype. Task computes and returns result according toCallablecontract.- Type Parameters:
T- the result type of the task- Parameters:
task- task to run in transaction, shall not benull- Returns:
- computed task result
- Throws:
TxException- when result computation failed
-
transaction
Execute providedtaskwith managed transaction of providedtype. Task computes and returns result according toCallablecontract.- Type Parameters:
T- the result type of the task- Parameters:
type- transaction type, shall not benulltask- task to run in transaction, shall not benull- Returns:
- computed task result
- Throws:
TxException- when result computation failed
-
transaction
Execute providedtaskwith managed transaction ofTx.Type.REQUIREDtype. Task does not return any result according toFunctions.CheckedRunnablecontract.- Parameters:
task- task to run in transaction, shall not benull- Throws:
TxException- when task computation failed
-
transaction
Execute providedtaskwith managed transaction of providedtype. Task does not return any result according toFunctions.CheckedRunnablecontract.- Parameters:
type- transaction type, shall not benulltask- task to run in transaction, shall not benull- Throws:
TxException- when task computation failed
-