Interface TransactionalTask<T extends Serializable>
- Type Parameters:
T- the type of the state, which must beSerializable
- All Superinterfaces:
PersistentTask<T>
- 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 TransactionalTask<T extends Serializable>
extends PersistentTask<T>
Similar to
PersistentTask but specifically for transactional workloads.
Use this interface when the task execution should be wrapped in a transaction.
This interface ensures that the task's execution is transactional, meaning that it will be executed within a transaction context, along with the state update and the dispatching of relevant events.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanWhether the persistentTask is transaction or not.Methods inherited from interface org.sterl.spring.persistent_tasks.api.task.PersistentTask
accept, afterTriggerFailed, retryStrategy
-
Method Details
-
isTransactional
default boolean isTransactional()Whether the persistentTask is transaction or not. Iftruethe execution is wrapped into the default transaction template together with the state update and the following events:- org.sterl.spring.persistent_tasks.trigger.event.TriggerRunningEvent
- org.sterl.spring.persistent_tasks.trigger.event.TriggerSuccessEvent
- Specified by:
isTransactionalin interfacePersistentTask<T extends Serializable>- Returns:
trueif the persistentTask is transactional;falseotherwise.
-