Class GlobalServerInterceptorRegistry
java.lang.Object
net.devh.boot.grpc.server.interceptor.GlobalServerInterceptorRegistry
The global server interceptor registry keeps references to all
ServerInterceptors that should be registered
to all server 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
ServerInterceptors.interceptForward(BindableService, ServerInterceptor...).
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalServerInterceptorRegistry(ApplicationContext applicationContext) Creates a new GlobalServerInterceptorRegistry. -
Method Summary
Modifier and TypeMethodDescriptionGets the immutable list of global server interceptors.protected List<ServerInterceptor>Initializes the list of server interceptors.voidsortInterceptors(List<? extends ServerInterceptor> interceptors) Sorts the given list of interceptors.
-
Constructor Details
-
GlobalServerInterceptorRegistry
Creates a new GlobalServerInterceptorRegistry.- Parameters:
applicationContext- The application context to fetch theGlobalServerInterceptorConfigurerbeans from.
-
-
Method Details
-
getServerInterceptors
Gets the immutable list of global server interceptors.- Returns:
- The list of globally registered server interceptors.
-
initServerInterceptors
Initializes the list of server interceptors.- Returns:
- The list of global server 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 abeanDefinitionAwareOrderComparator.- Parameters:
interceptors- The interceptors to sort.
-