Package io.grpc.stub
Class MetadataUtils.MetadataAttachingServerInterceptor
- java.lang.Object
-
- io.grpc.stub.MetadataUtils.MetadataAttachingServerInterceptor
-
- All Implemented Interfaces:
ServerInterceptor
- Enclosing class:
- MetadataUtils
private static final class MetadataUtils.MetadataAttachingServerInterceptor extends java.lang.Object implements ServerInterceptor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
MetadataUtils.MetadataAttachingServerInterceptor.MetadataAttachingServerCall<ReqT,RespT>
-
Constructor Summary
Constructors Constructor Description MetadataAttachingServerInterceptor(Metadata extras)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <ReqT,RespT>
ServerCall.Listener<ReqT>interceptCall(ServerCall<ReqT,RespT> call, Metadata headers, ServerCallHandler<ReqT,RespT> next)
-
-
-
Field Detail
-
extras
private final Metadata extras
-
-
Constructor Detail
-
MetadataAttachingServerInterceptor
MetadataAttachingServerInterceptor(Metadata extras)
-
-
Method Detail
-
interceptCall
public <ReqT,RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT,RespT> call, Metadata headers, ServerCallHandler<ReqT,RespT> next)
Description copied from interface:ServerInterceptor
InterceptServerCall
dispatch by thenext
ServerCallHandler
. General semantics ofServerCallHandler.startCall(io.grpc.ServerCall<RequestT, ResponseT>, io.grpc.Metadata)
apply and the returnedServerCall.Listener
must not benull
.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 usecall
on another thread.- Specified by:
interceptCall
in interfaceServerInterceptor
- Parameters:
call
- object to receive response messagesheaders
- which can contain extra call metadata fromClientCall.start(io.grpc.ClientCall.Listener<RespT>, io.grpc.Metadata)
, e.g. authentication credentials.next
- next processor in the interceptor chain- Returns:
- listener for processing incoming messages for
call
, nevernull
.
-
-