Enum Class Propagation

java.lang.Object
java.lang.Enum<Propagation>
com.ultikits.ultitools.annotations.Propagation
All Implemented Interfaces:
Serializable, Comparable<Propagation>, java.lang.constant.Constable

public enum Propagation extends Enum<Propagation>
Enum representing transaction propagation behaviors.

Propagation determines how a transaction behaves when it encounters an existing transaction context.

Since:
6.2.0
Author:
wisdomme
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Support a current transaction; throw an exception if no transaction exists.
    Execute within a nested transaction if a current transaction exists.
    Execute non-transactionally; throw an exception if a transaction exists.
    Execute non-transactionally, suspending the current transaction if one exists.
    Support a current transaction; create a new one if none exists.
    Create a new transaction, suspending the current transaction if one exists.
    Support a current transaction; execute non-transactionally if none exists.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static Propagation[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • REQUIRED

      public static final Propagation REQUIRED
      Support a current transaction; create a new one if none exists.

      This is the default propagation behavior. If a transaction exists, the method joins it. Otherwise, a new transaction is created.

    • REQUIRES_NEW

      public static final Propagation REQUIRES_NEW
      Create a new transaction, suspending the current transaction if one exists.

      Always creates a new independent transaction, even if one already exists. The existing transaction (if any) is suspended and resumed after completion.

    • SUPPORTS

      public static final Propagation SUPPORTS
      Support a current transaction; execute non-transactionally if none exists.

      If a transaction exists, the method joins it. Otherwise, it executes without a transaction.

    • NOT_SUPPORTED

      public static final Propagation NOT_SUPPORTED
      Execute non-transactionally, suspending the current transaction if one exists.

      Always executes without a transaction, suspending any existing one.

    • MANDATORY

      public static final Propagation MANDATORY
      Support a current transaction; throw an exception if no transaction exists.

      Requires an existing transaction. If none exists, an exception is thrown.

    • NEVER

      public static final Propagation NEVER
      Execute non-transactionally; throw an exception if a transaction exists.

      Cannot execute within a transaction. If one exists, an exception is thrown.

    • NESTED

      public static final Propagation NESTED
      Execute within a nested transaction if a current transaction exists.

      Creates a savepoint within the existing transaction. If no transaction exists, behaves like REQUIRED.

  • Constructor Details

    • Propagation

      private Propagation()
  • Method Details

    • values

      public static Propagation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Propagation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null