Class OrderedServerInterceptor
java.lang.Object
io.micronaut.grpc.server.interceptor.OrderedServerInterceptor
- All Implemented Interfaces:
io.grpc.ServerInterceptor,io.micronaut.core.order.Ordered
public class OrderedServerInterceptor
extends 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
- Author:
- brianwyka
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionOrderedServerInterceptor(io.grpc.ServerInterceptor delegate, int order) Constructs an instance of this interceptor with the provided delegate interceptor and order. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()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 todelegateinterceptor.
-
Constructor Details
-
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 toorder- the order number
-
-
Method Details
-
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 todelegateinterceptor.- Specified by:
interceptCallin interfaceio.grpc.ServerInterceptor
-
getOrder
public int getOrder()Get the order in which this interceptor should execute in the interceptor chain.- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered- Returns:
- the order
-