Class OrderedServerInterceptor

  • All Implemented Interfaces:
    io.grpc.ServerInterceptor, io.micronaut.core.order.Ordered

    public class OrderedServerInterceptor
    extends java.lang.Object
    implements io.grpc.ServerInterceptor, io.micronaut.core.order.Ordered
    A ServerInterceptor implementation which allows ordering and simply passes all calls to a delegate interceptor.
    Since:
    2.0.2
    • Field Summary

      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      OrderedServerInterceptor​(io.grpc.ServerInterceptor delegate, int order)
      Constructs an instance of this interceptor with the provided delegate interceptor and order.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getOrder()
      Get the order in which this interceptor should execute in the interceptor chain.
      <T,​S>
      io.grpc.ServerCall.Listener<T>
      interceptCall​(io.grpc.ServerCall<T,​S> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<T,​S> next)
      Delegates interceptor logic to delegate interceptor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OrderedServerInterceptor

        public OrderedServerInterceptor​(io.grpc.ServerInterceptor delegate,
                                        int order)
        Constructs an instance of this interceptor with the provided delegate interceptor and order.
        Parameters:
        delegate - the interceptor to delegate to
        order - the order number
    • Method Detail

      • interceptCall

        public <T,​S> io.grpc.ServerCall.Listener<T> interceptCall​(io.grpc.ServerCall<T,​S> call,
                                                                        io.grpc.Metadata headers,
                                                                        io.grpc.ServerCallHandler<T,​S> next)
        Delegates interceptor logic to delegate interceptor.
        Specified by:
        interceptCall in interface io.grpc.ServerInterceptor
      • getOrder

        public int getOrder()
        Get the order in which this interceptor should execute in the interceptor chain.
        Specified by:
        getOrder in interface io.micronaut.core.order.Ordered
        Returns:
        the order