java.lang.Object
io.helidon.transaction.Tx
Annotations and types related to transactional method execution.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface
Annotated method will be executed with managed transaction ofTx.Type.MANDATORY
type.static @interface
Annotated method will be executed with managed transaction ofTx.Type.NEVER
type.static @interface
Annotated method will be executed with managed transaction ofTx.Type.NEW
type.static @interface
Annotated method will be executed with managed transaction ofTx.Type.REQUIRED
type.static @interface
Annotated method will be executed with managed transaction ofTx.Type.SUPPORTED
type.static @interface
TransactionTx.Type
annotation.static enum
Transaction type.static @interface
Annotated method will be executed with managed transaction ofTx.Type.UNSUPPORTED
type. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Execute providedtask
with managed transaction ofTx.Type.REQUIRED
type.static void
transaction
(Tx.Type type, Functions.CheckedRunnable<Exception> task) Execute providedtask
with managed transaction of providedtype
.static <T> T
transaction
(Tx.Type type, Callable<T> task) Execute providedtask
with managed transaction of providedtype
.static <T> T
transaction
(Callable<T> task) Execute providedtask
with managed transaction ofTx.Type.REQUIRED
type.
-
Method Details
-
transaction
Execute providedtask
with managed transaction ofTx.Type.REQUIRED
type. Task computes and returns result according toCallable
contract.- 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 providedtask
with managed transaction of providedtype
. Task computes and returns result according toCallable
contract.- Type Parameters:
T
- the result type of the task- Parameters:
type
- transaction type, shall not benull
task
- task to run in transaction, shall not benull
- Returns:
- computed task result
- Throws:
TxException
- when result computation failed
-
transaction
Execute providedtask
with managed transaction ofTx.Type.REQUIRED
type. Task does not return any result according toFunctions.CheckedRunnable
contract.- Parameters:
task
- task to run in transaction, shall not benull
- Throws:
TxException
- when task computation failed
-
transaction
Execute providedtask
with managed transaction of providedtype
. Task does not return any result according toFunctions.CheckedRunnable
contract.- Parameters:
type
- transaction type, shall not benull
task
- task to run in transaction, shall not benull
- Throws:
TxException
- when task computation failed
-