Class GlobalClientInterceptorRegistry
java.lang.Object
net.devh.boot.grpc.client.interceptor.GlobalClientInterceptorRegistry
The global client interceptor registry keeps references to all
ClientInterceptors that should be registered
to all client channels. The interceptors will be applied in the same order they as specified by the
sortInterceptors(List) method.
Note: Custom interceptors will be appended to the global interceptors and applied using
ClientInterceptors.interceptForward(Channel, ClientInterceptor...).
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalClientInterceptorRegistry(ApplicationContext applicationContext) Creates a new GlobalClientInterceptorRegistry. -
Method Summary
Modifier and TypeMethodDescriptionGets the immutable list of global server interceptors.protected List<ClientInterceptor>Initializes the list of client interceptors.voidsortInterceptors(List<? extends ClientInterceptor> interceptors) Sorts the given list of interceptors.
-
Constructor Details
-
GlobalClientInterceptorRegistry
Creates a new GlobalClientInterceptorRegistry.- Parameters:
applicationContext- The application context to fetch theGlobalClientInterceptorConfigurerbeans from.
-
-
Method Details
-
getClientInterceptors
Gets the immutable list of global server interceptors.- Returns:
- The list of globally registered server interceptors.
-
initClientInterceptors
Initializes the list of client interceptors.- Returns:
- The list of global client interceptors.
-
sortInterceptors
Sorts the given list of interceptors. Use this method if you want to sort custom interceptors. The default implementation will sort them by using thenAnnotationAwareOrderComparator.- Parameters:
interceptors- The interceptors to sort.
-