Filter
- Type for service filterService
- Type for serviceFilterFactory
- Type for filter factorypublic abstract class GrpcServiceFactory<Filter extends Service,Service extends GrpcService,FilterFactory extends GrpcServiceFilterFactory<Filter,Service>>
extends java.lang.Object
GrpcServiceFactory.ServerBinder
.Modifier and Type | Class and Description |
---|---|
static interface |
GrpcServiceFactory.ServerBinder
A utility to bind an HTTP service for gRPC with an
appropriate programming model.
|
Modifier | Constructor and Description |
---|---|
protected |
GrpcServiceFactory(GrpcRoutes<Service> routes)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
GrpcServiceFactory<Filter,Service,FilterFactory> |
appendServiceFilter(FilterFactory before)
Appends the passed
FilterFactory to this factory. |
protected abstract FilterFactory |
appendServiceFilterFactory(FilterFactory existing,
FilterFactory append)
Appends the passed
FilterFactory to this service factory. |
Single<ServerContext> |
bind(GrpcServiceFactory.ServerBinder binder,
ExecutionContext executionContext)
Use the passed
GrpcServiceFactory.ServerBinder to bind an appropriate
gRPC service for the server. |
protected GrpcServiceFactory(GrpcRoutes<Service> routes)
routes
- GrpcRoutes
that will hold the routes for the constructed service.public final Single<ServerContext> bind(GrpcServiceFactory.ServerBinder binder, ExecutionContext executionContext)
GrpcServiceFactory.ServerBinder
to bind an appropriate
gRPC service for the server.binder
- GrpcServiceFactory.ServerBinder
to bind gRPC service to the server.executionContext
- ExecutionContext
to use for the service.Single
that completes when the server is successfully started or terminates with an error if
the server could not be started.public GrpcServiceFactory<Filter,Service,FilterFactory> appendServiceFilter(FilterFactory before)
FilterFactory
to this factory.
The order of execution of these filters are in order of append. If 3 filters are added as follows:
filter1.append(filter2).append(filter3)making a request to a client wrapped by this filter chain the order of invocation of these filters will be:
filter1 => filter2 => filter3 => client
before
- the factory to apply before this factory is appliedthis
protected abstract FilterFactory appendServiceFilterFactory(FilterFactory existing, FilterFactory append)
FilterFactory
to this service factory.existing
- Existing FilterFactory
.append
- FilterFactory
to append to existing
.before
factory and then applies existing
factory