Interface TransactionalTask<T extends Serializable>

Type Parameters:
T - the type of the state, which must be Serializable
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 Type
    Method
    Description
    default boolean
    Whether the persistentTask is transaction or not.

    Methods inherited from interface org.sterl.spring.persistent_tasks.api.task.PersistentTask

    accept, retryStrategy
  • Method Details

    • isTransactional

      default boolean isTransactional()
      Whether the persistentTask is transaction or not. If true the execution is wrapped into the default transaction template together with the state update and the following events:
      1. org.sterl.spring.persistent_tasks.trigger.event.TriggerRunningEvent
      2. org.sterl.spring.persistent_tasks.trigger.event.TriggerSuccessEvent
      Specified by:
      isTransactional in interface PersistentTask<T extends Serializable>
      Returns:
      true if the persistentTask is transactional; false otherwise.