Class GrpcRouting.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • intercept

        public GrpcRouting.Builder intercept​(io.grpc.ServerInterceptor... interceptors)
        Add one or more global ServerInterceptor instances that will intercept calls to all services in the GrpcRouting built by this builder.

        If the added interceptors are annotated with the Priority annotation then that value will be used to assign a priority to use when applying the interceptor otherwise a priority of InterceptorPriorities.USER will be used.

        Parameters:
        interceptors - one or more global ServerInterceptors
        Returns:
        this builder to allow fluent method chaining
      • intercept

        public GrpcRouting.Builder intercept​(int priority,
                                             io.grpc.ServerInterceptor... interceptors)
        Add one or more global ServerInterceptor instances that will intercept calls to all services in the GrpcRouting built by this builder.

        The added interceptors will be applied using the specified priority.

        Parameters:
        priority - the priority to assign to the interceptors
        interceptors - one or more global ServerInterceptors
        Returns:
        this builder to allow fluent method chaining
      • register

        public GrpcRouting.Builder register​(io.grpc.BindableService service)
        Add a BindableService with the GrpcRouting to be built by this builder.
        Parameters:
        service - the BindableService to register
        Returns:
        this builder to allow fluent method chaining
        Throws:
        IllegalArgumentException - if an attempt is made to register a service with the same name as an already registered service
      • register

        public GrpcRouting.Builder register​(io.grpc.BindableService service,
                                            ServiceDescriptor.Configurer configurer)
        Add a BindableService with the GrpcRouting to be built by this builder.
        Parameters:
        service - the BindableService to register
        configurer - an optional configurer that can update the ServiceDescriptor for the registered service
        Returns:
        this builder to allow fluent method chaining
        Throws:
        IllegalArgumentException - if an attempt is made to register a service with the same name as an already registered service