public class DelegatingGrpcServerBuilder extends Object implements GrpcServerBuilder
GrpcServerBuilder that delegates all methods to another GrpcServerBuilder.GrpcServerBuilder.HttpInitializer| Constructor and Description |
|---|
DelegatingGrpcServerBuilder(GrpcServerBuilder delegate) |
| Modifier and Type | Method and Description |
|---|---|
GrpcServerBuilder |
defaultTimeout(Duration defaultTimeout)
Set a default timeout during which gRPC calls are expected to complete.
|
GrpcServerBuilder |
defaultTimeout(Duration defaultTimeout,
boolean appendTimeoutFilter)
Set a default timeout during which gRPC calls are expected to complete.
|
protected GrpcServerBuilder |
delegate()
Returns the
GrpcServerBuilder delegate. |
GrpcServerBuilder |
initializeHttp(GrpcServerBuilder.HttpInitializer initializer)
Set a function which can configure the underlying
HttpServerBuilder used for the transport layer. |
GrpcServerBuilder |
lifecycleObserver(GrpcLifecycleObserver lifecycleObserver)
Sets a
GrpcLifecycleObserver that provides visibility into gRPC lifecycle events. |
Single<GrpcServerContext> |
listen(GrpcBindableService<?>... services)
Starts this server and returns the
GrpcServerContext after the server has been successfully started. |
Single<GrpcServerContext> |
listen(GrpcServiceFactory<?>... serviceFactories)
Starts this server and returns the
GrpcServerContext after the server has been successfully started. |
GrpcServerContext |
listenAndAwait(GrpcBindableService<?>... services)
Starts this server and returns the
GrpcServerContext after the server has been successfully started. |
GrpcServerContext |
listenAndAwait(GrpcServiceFactory<?>... serviceFactories)
Starts this server and returns the
GrpcServerContext after the server has been successfully started. |
String |
toString() |
public DelegatingGrpcServerBuilder(GrpcServerBuilder delegate)
protected final GrpcServerBuilder delegate()
GrpcServerBuilder delegate.GrpcServerBuilder.public String toString()
toString in class Objectpublic GrpcServerBuilder initializeHttp(GrpcServerBuilder.HttpInitializer initializer)
GrpcServerBuilderHttpServerBuilder used for the transport layer.initializeHttp in interface GrpcServerBuilderinitializer - Initializes the underlying HTTP transport builder.this.public GrpcServerBuilder defaultTimeout(Duration defaultTimeout)
GrpcServerBuilderdefaultTimeout in interface GrpcServerBuilderdefaultTimeout - Duration of default timeout which must be positive non-zero.this.GrpcServerBuilder.defaultTimeout(Duration, boolean)public GrpcServerBuilder defaultTimeout(@Nullable Duration defaultTimeout, boolean appendTimeoutFilter)
GrpcServerBuilderdefaultTimeout in interface GrpcServerBuilderdefaultTimeout - Duration of default timeout which must be positive non-zero, or null if a
default shouldn't be applied.appendTimeoutFilter - true to append the filter that enforces
deadline propagation. false to not append the filter and
therefore not enforce deadlines. If false you can manually insert
GrpcFilters.newGrpcDeadlineServerFilterFactory(Duration) in your preferred order use
GrpcServerBuilder.initializeHttp(io.servicetalk.grpc.api.GrpcServerBuilder.HttpInitializer) and
HttpServerBuilder.appendNonOffloadingServiceFilter(StreamingHttpServiceFilterFactory) (to force ordering
before any offloading filters) or
HttpServerBuilder.appendServiceFilter(StreamingHttpServiceFilterFactory) (if you require different
ordering).this.public GrpcServerBuilder lifecycleObserver(GrpcLifecycleObserver lifecycleObserver)
GrpcServerBuilderGrpcLifecycleObserver that provides visibility into gRPC lifecycle events.
Note, if GrpcServerBuilder.initializeHttp(HttpInitializer) is used to configure
HttpServerBuilder.lifecycleObserver(HttpLifecycleObserver) – that will override the value specified
using this method. Please choose only one approach.
lifecycleObserver in interface GrpcServerBuilderlifecycleObserver - A GrpcLifecycleObserver that provides visibility into gRPC lifecycle events.this.public Single<GrpcServerContext> listen(GrpcBindableService<?>... services)
GrpcServerBuilderGrpcServerContext after the server has been successfully started.
If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on address.
listen in interface GrpcServerBuilderservices - GrpcBindableService(s) to create a gRPC service.Single that completes when the server is successfully started or terminates with an error if
the server could not be started.public Single<GrpcServerContext> listen(GrpcServiceFactory<?>... serviceFactories)
GrpcServerBuilderGrpcServerContext after the server has been successfully started.
If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on address.
listen in interface GrpcServerBuilderserviceFactories - GrpcServiceFactory(s) to create a gRPC service.Single that completes when the server is successfully started or terminates with an error if
the server could not be started.public GrpcServerContext listenAndAwait(GrpcServiceFactory<?>... serviceFactories) throws Exception
GrpcServerBuilderGrpcServerContext after the server has been successfully started.
If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on address.
listenAndAwait in interface GrpcServerBuilderserviceFactories - GrpcServiceFactory(s) to create a gRPC service.GrpcServerContext by blocking the calling thread until the server is successfully started or
throws an Exception if the server could not be started.Exception - if the server could not be started.public GrpcServerContext listenAndAwait(GrpcBindableService<?>... services) throws Exception
GrpcServerBuilderGrpcServerContext after the server has been successfully started.
If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on address.
listenAndAwait in interface GrpcServerBuilderservices - GrpcBindableService(s) to create a gRPC service.GrpcServerContext by blocking the calling thread until the server is successfully started or
throws an Exception if the server could not be started.Exception - if the server could not be started.