Package net.devh.boot.grpc.common.util
Class InterceptorOrder
java.lang.Object
net.devh.boot.grpc.common.util.InterceptorOrder
A utility class with constants that can be used to configure the order of interceptors.
Note: The order constants provided by this class are just a suggestion to simplify the interoperability of multiple libraries and may be overridden. This library will use them for their own interceptors though.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The order value for interceptors that should be executed first.static final int
The order value for global exception handling interceptors.static final int
The order value for interceptors that should be executed last.static final int
The order value for security interceptors related to authentication.static final int
The order value for security interceptors related to authorization checks.static final int
The order value for interceptors related security exception handling.static final int
The order value for tracing and metrics collecting interceptors. -
Method Summary
Modifier and TypeMethodDescriptionstatic Comparator<Object>
beanFactoryAwareOrderComparator
(ApplicationContext context, Class<?> beanType) Creates a new Comparator that takesOrder
annotations on bean factory methods into account.
-
Field Details
-
ORDER_FIRST
public static final int ORDER_FIRSTThe order value for interceptors that should be executed first. This is equivalent toOrdered.HIGHEST_PRECEDENCE
.- See Also:
-
ORDER_GLOBAL_EXCEPTION_HANDLING
public static final int ORDER_GLOBAL_EXCEPTION_HANDLINGThe order value for global exception handling interceptors.- See Also:
-
ORDER_TRACING_METRICS
public static final int ORDER_TRACING_METRICSThe order value for tracing and metrics collecting interceptors.- See Also:
-
ORDER_SECURITY_EXCEPTION_HANDLING
public static final int ORDER_SECURITY_EXCEPTION_HANDLINGThe order value for interceptors related security exception handling.- See Also:
-
ORDER_SECURITY_AUTHENTICATION
public static final int ORDER_SECURITY_AUTHENTICATIONThe order value for security interceptors related to authentication.- See Also:
-
ORDER_SECURITY_AUTHORISATION
public static final int ORDER_SECURITY_AUTHORISATIONThe order value for security interceptors related to authorization checks.- See Also:
-
ORDER_LAST
public static final int ORDER_LASTThe order value for interceptors that should be executed last. This is equivalent toOrdered.LOWEST_PRECEDENCE
. This is the default for interceptors without specified priority.- See Also:
-
-
Method Details
-
beanFactoryAwareOrderComparator
public static Comparator<Object> beanFactoryAwareOrderComparator(ApplicationContext context, Class<?> beanType) Creates a new Comparator that takesOrder
annotations on bean factory methods into account.- Parameters:
context
- The application context to get the bean factory annotations form.beanType
- The type of the bean you wish to sort.- Returns:
- A newly created comparator for beans.
-