Enum Class Priority
- All Implemented Interfaces:
Serializable
,Comparable<Priority>
,Constable
The priority is an indicator for the level at which a
ModeWrapper
is applied. If
many modes exist, the order for applying may be important. The HIGHEST
ones are always applied last, while the LOWEST
are always
applied first. This leads to executing code of lower modes inside a higher mode.
This is important for transactions: If a transaction gets committed, a set of
CommitListener
s are executed. Thus, if
a privileged mode is nested within the transaction, the commit listeners get executed
after the privileged mode has been left. If the commit listener code should also
be executed within the privileged mode, the transaction must be commited while in
privileged mode.
For starting with this, there exist 5 priorities. The transaction mode is by default added
with priority LOWER
while all security modes (like privileged, runAs etc)
are added with priority HIGHER
. That allows for adding modes in between
(using NORMAL
) as well as before or after. Those default priorities can
always be overriden temporarily by specifying a priority with the Mode
that is used
to execute a task.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
-
Enum Constant Details
-
LOWEST
-
LOWER
-
NORMAL
-
HIGHER
-
HIGHEST
-
EXECUTION_CTX
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-