Package io.grpc
Class ClientInterceptors
- java.lang.Object
-
- io.grpc.ClientInterceptors
-
public class ClientInterceptors extends Object
Utility methods for working withClientInterceptors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClientInterceptors.CheckedForwardingClientCall<ReqT,RespT>AForwardingClientCallthat delivers exceptions from its start logic to the call listener.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
interceptForward
public static Channel interceptForward(Channel channel, 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- 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
public static Channel intercept(Channel channel, ClientInterceptor... interceptors)
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
public static Channel intercept(Channel channel, List<? extends ClientInterceptor> interceptors)
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.
-
-