@ThreadSafe public interface ClientInterceptor
Channel
.
Implementers use this mechanism to add cross-cutting behavior to Channel
and
stub implementations. Common examples of such behavior include:
Modifier and Type | Method and Description |
---|---|
<RequestT,ResponseT> |
interceptCall(MethodDescriptor<RequestT,ResponseT> method,
Channel next)
|
<RequestT,ResponseT> Call<RequestT,ResponseT> interceptCall(MethodDescriptor<RequestT,ResponseT> method, Channel next)
Call
creation by the next
Channel
.
Many variations of interception are possible. Complex implementations may return a wrapper
around the result of next.newCall()
, whereas a simpler implementation may just modify
the header metadata prior to returning the result of next.newCall()
.
method
- the remote method to be called.next
- the channel which is being intercepted.null
.