Package io.helidon.grpc.server
Class GrpcRouting.Builder
- 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 buildGrpcRouting
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GrpcRouting
build()
Builds a newGrpcRouting
.GrpcRouting.Builder
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.GrpcRouting.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.GrpcRouting.Builder
register(io.grpc.BindableService service)
Add aBindableService
with theGrpcRouting
to be built by this builder.GrpcRouting.Builder
register(io.grpc.BindableService service, ServiceDescriptor.Configurer configurer)
Add aBindableService
with theGrpcRouting
to be built by this builder.GrpcRouting.Builder
register(GrpcService service)
Add aGrpcService
with theGrpcRouting
to be built by this builder.GrpcRouting.Builder
register(GrpcService service, ServiceDescriptor.Configurer configurer)
Add aGrpcService
with theGrpcRouting
to be built by this builder.GrpcRouting.Builder
register(ServiceDescriptor service)
Register aServiceDescriptor
with theGrpcRouting
to be built by this builder.
-
-
-
Method Detail
-
intercept
public GrpcRouting.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.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
public GrpcRouting.Builder 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.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
public GrpcRouting.Builder register(GrpcService service)
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
public GrpcRouting.Builder register(GrpcService service, ServiceDescriptor.Configurer configurer)
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
public GrpcRouting.Builder register(io.grpc.BindableService service)
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
public GrpcRouting.Builder register(ServiceDescriptor service)
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
public GrpcRouting build()
Builds a newGrpcRouting
.- Specified by:
build
in interfaceBuilder<GrpcRouting>
- Returns:
- a new
GrpcRouting
instance
-
-