Package io.grpc
Class ClientInterceptors
java.lang.Object
io.grpc.ClientInterceptors
Utility methods for working with
ClientInterceptors.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAForwardingClientCallthat delivers exceptions from its start logic to the call listener. -
Method Summary
Modifier and TypeMethodDescriptionstatic Channelintercept(Channel channel, ClientInterceptor... interceptors) Create a newChannelthat will callinterceptorsbefore starting a call on the given channel.static Channelintercept(Channel channel, List<? extends ClientInterceptor> interceptors) Create a newChannelthat will callinterceptorsbefore starting a call on the given channel.static ChannelinterceptForward(Channel channel, ClientInterceptor... interceptors) Create a newChannelthat will callinterceptorsbefore starting a call on the given channel.static ChannelinterceptForward(Channel channel, List<? extends ClientInterceptor> interceptors) Create a newChannelthat will callinterceptorsbefore starting a call on the given channel.
-
Method Details
-
interceptForward
Create a newChannelthat will callinterceptorsbefore starting a call on the given channel. The first interceptor will have itsClientInterceptor.interceptCall(io.grpc.MethodDescriptor<ReqT, RespT>, io.grpc.CallOptions, io.grpc.Channel)called first.- Parameters:
channel- the underlying channel to intercept.interceptors- array of interceptors to bind tochannel.- Returns:
- a new channel instance with the interceptors applied.
-
interceptForward
public static Channel interceptForward(Channel channel, List<? extends ClientInterceptor> interceptors) Create a newChannelthat will callinterceptorsbefore starting a call on the given channel. The first interceptor will have itsClientInterceptor.interceptCall(io.grpc.MethodDescriptor<ReqT, RespT>, io.grpc.CallOptions, io.grpc.Channel)called first.- Parameters:
channel- the underlying channel to intercept.interceptors- a list of interceptors to bind tochannel.- Returns:
- a new channel instance with the interceptors applied.
-
intercept
Create a newChannelthat will callinterceptorsbefore starting a call on the given channel. The last interceptor will have itsClientInterceptor.interceptCall(io.grpc.MethodDescriptor<ReqT, RespT>, io.grpc.CallOptions, io.grpc.Channel)called first.- Parameters:
channel- the underlying channel to intercept.interceptors- array of interceptors to bind tochannel.- Returns:
- a new channel instance with the interceptors applied.
-
intercept
Create a newChannelthat will callinterceptorsbefore starting a call on the given channel. The last interceptor will have itsClientInterceptor.interceptCall(io.grpc.MethodDescriptor<ReqT, RespT>, io.grpc.CallOptions, io.grpc.Channel)called first.- Parameters:
channel- the underlying channel to intercept.interceptors- a list of interceptors to bind tochannel.- Returns:
- a new channel instance with the interceptors applied.
-