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
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newGrpcRouting
.intercept
(int priority, io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built by this builder.intercept
(io.grpc.ServerInterceptor... interceptors) Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built by this builder.register
(io.grpc.BindableService service) Add aBindableService
with theGrpcRouting
to be built by this builder.register
(io.grpc.BindableService service, ServiceDescriptor.Configurer configurer) Add aBindableService
with theGrpcRouting
to be built by this builder.register
(GrpcService service) Add aGrpcService
with theGrpcRouting
to be built by this builder.register
(GrpcService service, ServiceDescriptor.Configurer configurer) Add aGrpcService
with theGrpcRouting
to be built by this builder.register
(ServiceDescriptor service) Register aServiceDescriptor
with theGrpcRouting
to be built by this builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
intercept
Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
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 ofInterceptorPriorities.USER
will be used.- Parameters:
interceptors
- one or more globalServerInterceptor
s- Returns:
- this builder to allow fluent method chaining
-
intercept
Add one or more globalServerInterceptor
instances that will intercept calls to all services in theGrpcRouting
built 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 globalServerInterceptor
s- Returns:
- this builder to allow fluent method chaining
-
register
Add aGrpcService
with theGrpcRouting
to be built by this builder.- Parameters:
service
- theGrpcService
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
Add aGrpcService
with theGrpcRouting
to be built by this builder.- Parameters:
service
- theGrpcService
to registerconfigurer
- an optional configurer that can update theServiceDescriptor
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
-
register
Add aBindableService
with theGrpcRouting
to be built by this builder.- Parameters:
service
- theBindableService
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 aBindableService
with theGrpcRouting
to be built by this builder.- Parameters:
service
- theBindableService
to registerconfigurer
- an optional configurer that can update theServiceDescriptor
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
-
register
Register aServiceDescriptor
with theGrpcRouting
to be built by this builder.- Parameters:
service
- theServiceDescriptor
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
-
build
Builds a newGrpcRouting
.- Specified by:
build
in interfaceBuilder<GrpcRouting.Builder,
GrpcRouting> - Returns:
- a new
GrpcRouting
instance
-