Enum ReentryInhibition
- java.lang.Object
-
- java.lang.Enum<ReentryInhibition>
-
- com.perfino.annotation.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. BothClassTransaction
andMethodTransaction
prevent the creation of nested transaction with the same name. More restrictive strategies can be configured by settingClassTransaction.reentryInhibition()
orMethodTransaction.reentryInhibition()
to something other thanNAME
.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.
-
-
-
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
withClassTransaction.inheritance()
set toInheritance.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, asuper()
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()
orMethodTransaction.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
orMethodTransaction
. 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 namejava.lang.NullPointerException
- if the argument is null
-
-