PriorityPrecedence
Constants for use with jakarta.annotation.Priority , used both to determine which service to inject into a scalar field when there are multiple candidates, and also to order services if injecting into a vector field (in other words, into a java.util.List ).
API
class PriorityPrecedence {
public static final int FIRST; (1)
public static final int LAST; (2)
public static final int MIDPOINT; (3)
public static final int EARLY; (4)
public static final int LATE; (5)
}
1 | FIRST
For domain services with the highest precedence (priority) value. |
2 | LAST
For domain services that act as a fallback, and which will typically be overridden. |
3 | MIDPOINT
For framework for services that could be overridden by application code (though not commonly). |
4 | EARLY
For framework for services that are unlikely to be overridden by application code. |
5 | LATE
For framework services that are expected to be overridden by application code, or that act as a fallback. |
Members
FIRST
For domain services with the highest precedence (priority) value.
No framework services use this constant, but some very fundamental services (eg for security) that are not expected to be overridden use a value that is only a little after this first value.
Note that this is a non-negative value, because jakarta.annotation.Priority 's javadoc states: "priority values should generally be non-negative, with negative values * reserved for special meanings such as undefined or not specified .". In particular, it is not the same as Ordered#HIGHEST_PRECEDENCE .