Package io.servicetalk.grpc.api
Class DelegatingGrpcServerBuilder
java.lang.Object
io.servicetalk.grpc.api.DelegatingGrpcServerBuilder
- All Implemented Interfaces:
GrpcServerBuilder
A
GrpcServerBuilder that delegates all methods to another GrpcServerBuilder.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.servicetalk.grpc.api.GrpcServerBuilder
GrpcServerBuilder.HttpInitializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefaultTimeout(Duration defaultTimeout) Set a default timeout during which gRPC calls are expected to complete.defaultTimeout(Duration defaultTimeout, boolean appendTimeoutFilter) Set a default timeout during which gRPC calls are expected to complete.protected final GrpcServerBuilderdelegate()Returns theGrpcServerBuilderdelegate.initializeHttp(GrpcServerBuilder.HttpInitializer initializer) Set a function which can configure the underlyingHttpServerBuilderused for the transport layer.lifecycleObserver(GrpcLifecycleObserver lifecycleObserver) Sets aGrpcLifecycleObserverthat provides visibility into gRPC lifecycle events.listen(GrpcBindableService<?>... services) Starts this server and returns theGrpcServerContextafter the server has been successfully started.listen(GrpcServiceFactory<?>... serviceFactories) Starts this server and returns theGrpcServerContextafter the server has been successfully started.listenAndAwait(GrpcBindableService<?>... services) Starts this server and returns theGrpcServerContextafter the server has been successfully started.listenAndAwait(GrpcServiceFactory<?>... serviceFactories) Starts this server and returns theGrpcServerContextafter the server has been successfully started.toString()
-
Constructor Details
-
DelegatingGrpcServerBuilder
-
-
Method Details
-
delegate
Returns theGrpcServerBuilderdelegate.- Returns:
- Delegate
GrpcServerBuilder.
-
toString
-
initializeHttp
Description copied from interface:GrpcServerBuilderSet a function which can configure the underlyingHttpServerBuilderused for the transport layer.- Specified by:
initializeHttpin interfaceGrpcServerBuilder- Parameters:
initializer- Initializes the underlying HTTP transport builder.- Returns:
this.
-
defaultTimeout
Description copied from interface:GrpcServerBuilderSet a default timeout during which gRPC calls are expected to complete. This default will be used only if the request includes no timeout; any value specified in client request will supersede this default.- Specified by:
defaultTimeoutin interfaceGrpcServerBuilder- Parameters:
defaultTimeout-Durationof default timeout which must be positive non-zero.- Returns:
this.- See Also:
-
defaultTimeout
public GrpcServerBuilder defaultTimeout(@Nullable Duration defaultTimeout, boolean appendTimeoutFilter) Description copied from interface:GrpcServerBuilderSet a default timeout during which gRPC calls are expected to complete. This default will be used only if the request includes no timeout; any value specified in client request will supersede this default.- Specified by:
defaultTimeoutin interfaceGrpcServerBuilder- Parameters:
defaultTimeout-Durationof default timeout which must be positive non-zero, ornullif a default shouldn't be applied.appendTimeoutFilter-trueto append the filter that enforces deadline propagation.falseto not append the filter and therefore not enforce deadlines. Iffalseyou can manually insertGrpcFilters.newGrpcDeadlineServerFilterFactory(Duration)in your preferred order useGrpcServerBuilder.initializeHttp(io.servicetalk.grpc.api.GrpcServerBuilder.HttpInitializer)andHttpServerBuilder.appendNonOffloadingServiceFilter(StreamingHttpServiceFilterFactory)(to force ordering before any offloading filters) orHttpServerBuilder.appendServiceFilter(StreamingHttpServiceFilterFactory)(if you require different ordering).- Returns:
this.
-
lifecycleObserver
Description copied from interface:GrpcServerBuilderSets aGrpcLifecycleObserverthat provides visibility into gRPC lifecycle events.Note, if
GrpcServerBuilder.initializeHttp(HttpInitializer)is used to configureHttpServerBuilder.lifecycleObserver(HttpLifecycleObserver)– that will override the value specified using this method. Please choose only one approach.- Specified by:
lifecycleObserverin interfaceGrpcServerBuilder- Parameters:
lifecycleObserver- AGrpcLifecycleObserverthat provides visibility into gRPC lifecycle events.- Returns:
this.
-
listen
Description copied from interface:GrpcServerBuilderStarts this server and returns theGrpcServerContextafter the server has been successfully started.If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenin interfaceGrpcServerBuilder- Parameters:
services-GrpcBindableService(s) to create a gRPC service.- Returns:
- A
Singlethat completes when the server is successfully started or terminates with an error if the server could not be started.
-
listen
Description copied from interface:GrpcServerBuilderStarts this server and returns theGrpcServerContextafter the server has been successfully started.If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenin interfaceGrpcServerBuilder- Parameters:
serviceFactories-GrpcServiceFactory(s) to create a gRPC service.- Returns:
- A
Singlethat completes when the server is successfully started or terminates with an error if the server could not be started.
-
listenAndAwait
Description copied from interface:GrpcServerBuilderStarts this server and returns theGrpcServerContextafter the server has been successfully started.If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenAndAwaitin interfaceGrpcServerBuilder- Parameters:
serviceFactories-GrpcServiceFactory(s) to create a gRPC service.- Returns:
- A
GrpcServerContextby blocking the calling thread until the server is successfully started or throws anExceptionif the server could not be started. - Throws:
Exception- if the server could not be started.
-
listenAndAwait
Description copied from interface:GrpcServerBuilderStarts this server and returns theGrpcServerContextafter the server has been successfully started.If the underlying protocol (eg. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenAndAwaitin interfaceGrpcServerBuilder- Parameters:
services-GrpcBindableService(s) to create a gRPC service.- Returns:
- A
GrpcServerContextby blocking the calling thread until the server is successfully started or throws anExceptionif the server could not be started. - Throws:
Exception- if the server could not be started.
-