public class MetadataInterceptor<ReqT,ResT> extends SimpleInterceptor<ReqT,ResT>
Constructor and Description |
---|
MetadataInterceptor(io.grpc.Metadata metadata)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
static InterceptorFactory |
newFactory(io.grpc.Metadata metadata)
Creates an
InterceptorFactory with a given endpoint . |
void |
onHalfClose(ReqT req,
io.grpc.Metadata headers)
gRPC invokes the actual method implementation in the onHalfClose method.
|
void |
onStart(ReqT req,
io.grpc.Metadata headers)
Invoked when request is starting.
|
onComplete
public MetadataInterceptor(io.grpc.Metadata metadata)
metadata
- to addpublic static InterceptorFactory newFactory(io.grpc.Metadata metadata)
InterceptorFactory
with a given endpoint
.metadata
- metadatapublic void onStart(ReqT req, io.grpc.Metadata headers)
SimpleInterceptor
onStart
in class SimpleInterceptor<ReqT,ResT>
req
- proto requestheaders
- request metadatapublic void onHalfClose(ReqT req, io.grpc.Metadata headers)
SimpleInterceptor
The method can potentially be invoked on a thread different from the
one that called SimpleInterceptor.onStart(ReqT, io.grpc.Metadata)
. So all the features that rely on
thread local for processing need to perform the initialization in this
method and NOT in SimpleInterceptor.onStart(ReqT, io.grpc.Metadata)
.
onHalfClose
in class SimpleInterceptor<ReqT,ResT>
req
- proto requestheaders
- request metadata