Class InterceptorOrder

java.lang.Object
net.devh.boot.grpc.common.util.InterceptorOrder

public final class InterceptorOrder extends Object
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 Details

    • ORDER_FIRST

      public static final int ORDER_FIRST
      The order value for interceptors that should be executed first. This is equivalent to Ordered.HIGHEST_PRECEDENCE.
      See Also:
    • ORDER_GLOBAL_EXCEPTION_HANDLING

      public static final int ORDER_GLOBAL_EXCEPTION_HANDLING
      The order value for global exception handling interceptors.
      See Also:
    • ORDER_TRACING_METRICS

      public static final int ORDER_TRACING_METRICS
      The order value for tracing and metrics collecting interceptors.
      See Also:
    • ORDER_SECURITY_EXCEPTION_HANDLING

      public static final int ORDER_SECURITY_EXCEPTION_HANDLING
      The order value for interceptors related security exception handling.
      See Also:
    • ORDER_SECURITY_AUTHENTICATION

      public static final int ORDER_SECURITY_AUTHENTICATION
      The order value for security interceptors related to authentication.
      See Also:
    • ORDER_SECURITY_AUTHORISATION

      public static final int ORDER_SECURITY_AUTHORISATION
      The order value for security interceptors related to authorization checks.
      See Also:
    • ORDER_LAST

      public static final int ORDER_LAST
      The order value for interceptors that should be executed last. This is equivalent to Ordered.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 takes Order 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.