ReqT
- request typeResT
- response typepublic abstract class SimpleInterceptor<ReqT,ResT>
extends java.lang.Object
Constructor and Description |
---|
SimpleInterceptor() |
Modifier and Type | Method and Description |
---|---|
io.grpc.Status |
onComplete(io.grpc.Status status,
ReqT req,
ResT res,
io.grpc.Metadata trailers)
Invoked when request is finished.
|
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.
|
public void onStart(ReqT req, io.grpc.Metadata headers)
req
- proto requestheaders
- request metadatapublic void onHalfClose(ReqT req, io.grpc.Metadata headers)
The method can potentially be invoked on a thread different from the
one that called 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 onStart(ReqT, io.grpc.Metadata)
.
req
- proto requestheaders
- request metadatapublic io.grpc.Status onComplete(io.grpc.Status status, ReqT req, @Nullable ResT res, @Nullable io.grpc.Metadata trailers)
status
- request status, if not successful response is not going to be presentreq
- proto requesttrailers
- response metadatares
- proto response