- java.lang.Object
-
- io.helidon.grpc.server.GrpcRouting.Builder
-
- All Implemented Interfaces:
Builder<GrpcRouting>,Supplier<GrpcRouting>
- Enclosing interface:
- GrpcRouting
public static final class GrpcRouting.Builder extends Object implements Builder<GrpcRouting>
A builder that can buildGrpcRoutinginstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcRoutingbuild()Builds a newGrpcRouting.GrpcRouting.Builderintercept(int priority, io.grpc.ServerInterceptor... interceptors)Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.GrpcRouting.Builderintercept(io.grpc.ServerInterceptor... interceptors)Add one or more globalServerInterceptorinstances that will intercept calls to all services in theGrpcRoutingbuilt by this builder.GrpcRouting.Builderregister(io.grpc.BindableService service)Add aBindableServicewith theGrpcRoutingto be built by this builder.GrpcRouting.Builderregister(io.grpc.BindableService service, ServiceDescriptor.Configurer configurer)Add aBindableServicewith theGrpcRoutingto be built by this builder.GrpcRouting.Builderregister(GrpcService service)Add aGrpcServicewith theGrpcRoutingto be built by this builder.GrpcRouting.Builderregister(GrpcService service, ServiceDescriptor.Configurer configurer)Add aGrpcServicewith theGrpcRoutingto be built by this builder.GrpcRouting.Builderregister(ServiceDescriptor service)Register aServiceDescriptorwith theGrpcRoutingto be built by this builder.
-
-
-
Method Detail
-
intercept
public GrpcRouting.Builder intercept(io.grpc.ServerInterceptor... interceptors)
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
public GrpcRouting.Builder intercept(int priority, io.grpc.ServerInterceptor... interceptors)
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
public GrpcRouting.Builder register(GrpcService service)
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
public GrpcRouting.Builder register(GrpcService service, ServiceDescriptor.Configurer configurer)
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
public GrpcRouting.Builder register(io.grpc.BindableService service)
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
public GrpcRouting.Builder register(ServiceDescriptor service)
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
public GrpcRouting build()
Builds a newGrpcRouting.- Specified by:
buildin interfaceBuilder<GrpcRouting>- Returns:
- a new
GrpcRoutinginstance
-
-