Class AnnotationGlobalServerInterceptorConfigurer
java.lang.Object
net.devh.boot.grpc.server.interceptor.AnnotationGlobalServerInterceptorConfigurer
- All Implemented Interfaces:
GlobalServerInterceptorConfigurer
public class AnnotationGlobalServerInterceptorConfigurer
extends Object
implements GlobalServerInterceptorConfigurer
Automatically find and configure
annotated global ServerInterceptors.-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationGlobalServerInterceptorConfigurer(ApplicationContext applicationContext) Creates a new AnnotationGlobalServerInterceptorConfigurer. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureServerInterceptors(List<ServerInterceptor> interceptors) Configures the given list of server interceptors, possibly adding new elements, removing unwanted elements, or reordering the existing ones.protected Map<String,ServerInterceptor> Helper method used to get theGrpcGlobalServerInterceptorannotatedServerInterceptors from the application context.
-
Constructor Details
-
AnnotationGlobalServerInterceptorConfigurer
Creates a new AnnotationGlobalServerInterceptorConfigurer.- Parameters:
applicationContext- The application context to fetch theGrpcGlobalServerInterceptorannotatedServerInterceptorbeans from.
-
-
Method Details
-
getServerInterceptorBeans
Helper method used to get theGrpcGlobalServerInterceptorannotatedServerInterceptors from the application context.- Returns:
- A map containing the global interceptor beans.
-
configureServerInterceptors
Description copied from interface:GlobalServerInterceptorConfigurerConfigures the given list of server interceptors, possibly adding new elements, removing unwanted elements, or reordering the existing ones.- Specified by:
configureServerInterceptorsin interfaceGlobalServerInterceptorConfigurer- Parameters:
interceptors- A mutable list of server interceptors to configure.
-