Enum ReentryInhibition

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ReentryInhibition>

    public enum ReentryInhibition
    extends java.lang.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 Summary

      Enum Constants 
      Enum Constant Description
      ALL
      Prevent all further nested transactions.
      ANNOTATION
      Prevent directly nested transactions defined by the same annotation.
      DEV_OPS
      Prevent all directly nested DevOps transactions.
      GROUP
      Prevent directly nested transactions with the same group name.
      NAME
      Prevent directly nested transactions with the same name.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ReentryInhibition valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ReentryInhibition[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

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

      • 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 would have 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 is 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, i.e. 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 Detail

      • values

        public static ReentryInhibition[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ReentryInhibition c : ReentryInhibition.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ReentryInhibition valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null