Enum Class ReentryInhibition

java.lang.Object
java.lang.Enum<ReentryInhibition>
com.perfino.annotation.ReentryInhibition
All Implemented Interfaces:
Serializable, Comparable<ReentryInhibition>, Constable

public enum ReentryInhibition extends Enum<ReentryInhibition>
Limits the creation of nested transactions. When an outer transaction is underway, nested transactions are recorded into a call tree. Both ClassTransaction and MethodTransaction prevent the creation of nested transaction with the same name. More restrictive strategies can be configured by setting ClassTransaction.reentryInhibition() or MethodTransaction.reentryInhibition() to something other than NAME.

The reentry inhibition only applies to the transactions that would be directly nested. If a nested transaction is allowed, its own reentry inhibition setting will be used for the next nesting level.

  • Enum Constant Details

    • NAME

      public static final ReentryInhibition NAME
      Prevent directly nested transactions with the same name.

      A simple example is the recursive invocation of the same method where you might not want to see nested transactions with the same name in the call tree.

      As another example, a ClassTransaction with ClassTransaction.inheritance() set to Inheritance.Mode.WITH_SUPERCLASS_NAME will instrument a method and all its overriding methods in derived classes. After a method call into a derived class has started a transaction, a super() call in that method would create another transaction of the same name. This reentry inhibition mode prevents the creation of that nested transaction.

      This is the default setting for ClassTransaction.reentryInhibition().

    • ANNOTATION

      public static final ReentryInhibition ANNOTATION
      Prevent directly nested transactions defined by the same annotation.

      This prevents nested transactions for recursive calls even they have a different name.

      As another example, a ClassTransaction instruments all public methods in a class. When public method A has started a transaction and calls method B, no nested transaction is created even if it has a different name.

      This is the default setting for MethodTransaction.reentryInhibition().

    • GROUP

      public static final ReentryInhibition GROUP
      Prevent directly nested transactions with the same group name.

      A group name is specified with ClassTransaction.group() or MethodTransaction.group(). When a transaction with a particular group name is in progress, no nested transactions with the same group name will be created. If you have multiple entry points that may call each other, but you are not interested in resolving the internal structure, use this reentry inhibition mode.

    • DEV_OPS

      public static final ReentryInhibition DEV_OPS
      Prevent all directly nested DevOps transactions.

      DevOps transactions are transactions created through this API via ClassTransaction or MethodTransaction. Note that other transactions types that can be configured in the perfino UI, like POJO or EJB transactions, can still nest with DevOps transactions.

    • ALL

      public static final ReentryInhibition ALL
      Prevent all further nested transactions.
  • Method Details

    • values

      public static ReentryInhibition[] 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 ReentryInhibition 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