@ThreadSafe public interface ServerInterceptor
ServerCallHandler
.
Implementers use this mechanism to add cross-cutting behavior to server-side calls. Common example of such behavior include:
Modifier and Type | Method and Description |
---|---|
<RequestT,ResponseT> |
interceptCall(String method,
ServerCall<ResponseT> call,
Metadata.Headers headers,
ServerCallHandler<RequestT,ResponseT> next)
|
<RequestT,ResponseT> ServerCall.Listener<RequestT> interceptCall(String method, ServerCall<ResponseT> call, Metadata.Headers headers, ServerCallHandler<RequestT,ResponseT> next)
ServerCall
dispatch by the next
ServerCallHandler
. General
semantics of ServerCallHandler.startCall(java.lang.String, io.grpc.ServerCall<ResponseT>, io.grpc.Metadata.Headers)
apply and the returned
ServerCall.Listener
must not be null
.
If the implementation throws an exception, call
will be closed with an error.
Implementations must not throw an exception if they started processing that may use call
on another thread.
method
- fully qualified method name of the callcall
- object to receive response messagesnext
- next processor in the interceptor chaincall
, never null
.