java.lang.Object
io.helidon.grpc.server.GrpcRouting.Builder
- All Implemented Interfaces:
Builder<GrpcRouting.Builder,,GrpcRouting> Supplier<GrpcRouting>
- Enclosing interface:
- GrpcRouting
public static final class GrpcRouting.Builder
extends Object
implements Builder<GrpcRouting.Builder,GrpcRouting>
A builder that can build
GrpcRouting instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newGrpcRouting.intercept(int priority, io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.intercept(io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.register(io.grpc.BindableService service) Add aBindableServicewith theGrpcRoutingto be built by this builder.register(io.grpc.BindableService service, ServiceDescriptor.Configurer configurer) Add aBindableServicewith theGrpcRoutingto be built by this builder.register(GrpcService service) Add aGrpcServicewith theGrpcRoutingto be built by this builder.register(GrpcService service, ServiceDescriptor.Configurer configurer) Add aGrpcServicewith theGrpcRoutingto be built by this builder.register(ServiceDescriptor service) Register aServiceDescriptorwith theGrpcRoutingto be built by this builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
intercept
Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.If the added interceptors are annotated with the
Priorityannotation then that value will be used to assign a priority to use when applying the interceptor otherwise a priority ofInterceptorPriorities.USERwill be used.- Parameters:
interceptors- one or more globalServerInterceptors- Returns:
- this builder to allow fluent method chaining
-
intercept
Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.The added interceptors will be applied using the specified priority.
- Parameters:
priority- the priority to assign to the interceptorsinterceptors- one or more globalServerInterceptors- Returns:
- this builder to allow fluent method chaining
-
register
Add aGrpcServicewith theGrpcRoutingto be built by this builder.- Parameters:
service- theGrpcServiceto 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
Add aGrpcServicewith theGrpcRoutingto be built by this builder.- Parameters:
service- theGrpcServiceto registerconfigurer- an optional configurer that can update theServiceDescriptorfor 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
-
register
Add aBindableServicewith theGrpcRoutingto be built by this builder.- Parameters:
service- theBindableServiceto 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 aBindableServicewith theGrpcRoutingto be built by this builder.- Parameters:
service- theBindableServiceto registerconfigurer- an optional configurer that can update theServiceDescriptorfor 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
-
register
Register aServiceDescriptorwith theGrpcRoutingto be built by this builder.- Parameters:
service- theServiceDescriptorto 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
-
build
Builds a newGrpcRouting.- Specified by:
buildin interfaceBuilder<GrpcRouting.Builder,GrpcRouting> - Returns:
- a new
GrpcRoutinginstance
-