Package io.grpc
Class ClientInterceptors
- java.lang.Object
-
- io.grpc.ClientInterceptors
-
public class ClientInterceptors extends Object
Utility methods for working withClientInterceptor
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClientInterceptors.CheckedForwardingClientCall<ReqT,RespT>
AForwardingClientCall
that delivers exceptions from its start logic to the call listener.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Channel
intercept(Channel channel, ClientInterceptor... interceptors)
Create a newChannel
that will callinterceptors
before starting a call on the given channel.static Channel
intercept(Channel channel, List<? extends ClientInterceptor> interceptors)
Create a newChannel
that will callinterceptors
before starting a call on the given channel.static Channel
interceptForward(Channel channel, ClientInterceptor... interceptors)
Create a newChannel
that will callinterceptors
before starting a call on the given channel.static Channel
interceptForward(Channel channel, List<? extends ClientInterceptor> interceptors)
Create a newChannel
that will callinterceptors
before starting a call on the given channel.
-
-
-
Method Detail
-
interceptForward
public static Channel interceptForward(Channel channel, ClientInterceptor... interceptors)
Create a newChannel
that will callinterceptors
before 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 newChannel
that will callinterceptors
before 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 newChannel
that will callinterceptors
before 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 newChannel
that will callinterceptors
before 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.
-
-