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 GrpcServerBuilder
delegate()
Returns theGrpcServerBuilder
delegate.initializeHttp
(GrpcServerBuilder.HttpInitializer initializer) Set a function which can configure the underlyingHttpServerBuilder
used for the transport layer.lifecycleObserver
(GrpcLifecycleObserver lifecycleObserver) Sets aGrpcLifecycleObserver
that provides visibility into gRPC lifecycle events.listen
(GrpcBindableService<?>... services) Starts this server and returns theGrpcServerContext
after the server has been successfully started.listen
(GrpcServiceFactory<?>... serviceFactories) Starts this server and returns theGrpcServerContext
after the server has been successfully started.listenAndAwait
(GrpcBindableService<?>... services) Starts this server and returns theGrpcServerContext
after the server has been successfully started.listenAndAwait
(GrpcServiceFactory<?>... serviceFactories) Starts this server and returns theGrpcServerContext
after the server has been successfully started.toString()
-
Constructor Details
-
DelegatingGrpcServerBuilder
-
-
Method Details
-
delegate
Returns theGrpcServerBuilder
delegate.- Returns:
- Delegate
GrpcServerBuilder
.
-
toString
-
initializeHttp
Description copied from interface:GrpcServerBuilder
Set a function which can configure the underlyingHttpServerBuilder
used for the transport layer.- Specified by:
initializeHttp
in interfaceGrpcServerBuilder
- Parameters:
initializer
- Initializes the underlying HTTP transport builder.- Returns:
this
.
-
defaultTimeout
Description copied from interface:GrpcServerBuilder
Set 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:
defaultTimeout
in interfaceGrpcServerBuilder
- Parameters:
defaultTimeout
-Duration
of 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:GrpcServerBuilder
Set 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:
defaultTimeout
in interfaceGrpcServerBuilder
- Parameters:
defaultTimeout
-Duration
of default timeout which must be positive non-zero, ornull
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. Iffalse
you 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:GrpcServerBuilder
Sets aGrpcLifecycleObserver
that 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:
lifecycleObserver
in interfaceGrpcServerBuilder
- Parameters:
lifecycleObserver
- AGrpcLifecycleObserver
that provides visibility into gRPC lifecycle events.- Returns:
this
.
-
listen
Description copied from interface:GrpcServerBuilder
Starts this server and returns theGrpcServerContext
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
.- Specified by:
listen
in interfaceGrpcServerBuilder
- Parameters:
services
-GrpcBindableService
(s) to create a gRPC service.- Returns:
- A
Single
that completes when the server is successfully started or terminates with an error if the server could not be started.
-
listen
Description copied from interface:GrpcServerBuilder
Starts this server and returns theGrpcServerContext
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
.- Specified by:
listen
in interfaceGrpcServerBuilder
- Parameters:
serviceFactories
-GrpcServiceFactory
(s) to create a gRPC service.- Returns:
- A
Single
that completes when the server is successfully started or terminates with an error if the server could not be started.
-
listenAndAwait
Description copied from interface:GrpcServerBuilder
Starts this server and returns theGrpcServerContext
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
.- Specified by:
listenAndAwait
in interfaceGrpcServerBuilder
- Parameters:
serviceFactories
-GrpcServiceFactory
(s) to create a gRPC service.- Returns:
- A
GrpcServerContext
by blocking the calling thread until the server is successfully started or throws anException
if the server could not be started. - Throws:
Exception
- if the server could not be started.
-
listenAndAwait
Description copied from interface:GrpcServerBuilder
Starts this server and returns theGrpcServerContext
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
.- Specified by:
listenAndAwait
in interfaceGrpcServerBuilder
- Parameters:
services
-GrpcBindableService
(s) to create a gRPC service.- Returns:
- A
GrpcServerContext
by blocking the calling thread until the server is successfully started or throws anException
if the server could not be started. - Throws:
Exception
- if the server could not be started.
-