Class DelegatingHttpServerBuilder
- All Implemented Interfaces:
HttpServerBuilder
HttpServerBuilder that delegates all methods to another HttpServerBuilder.-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingHttpServerBuilder(HttpServerBuilder delegate) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionallowDropRequestTrailers(boolean allowDrop) Provide a hint if request trailers are allowed to be dropped.Appends the filter to the chain of filters used to decorate theConnectionAcceptorused by this builder.Appends theEarlyConnectionAcceptorto be called when a new connection has been created.Appends theLateConnectionAcceptorto be called when a new connection has been created.Appends a non-offloading filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder.appendNonOffloadingServiceFilter(Predicate<StreamingHttpRequest> predicate, StreamingHttpServiceFilterFactory factory) Appends a non-offloading filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder, for every request that passes the providedPredicate.Appends the filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder.appendServiceFilter(Predicate<StreamingHttpRequest> predicate, StreamingHttpServiceFilterFactory factory) Appends the filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder, for every request that passes the providedPredicate.bufferAllocator(BufferAllocator allocator) Sets theBufferAllocatorto be used by this server.protected final HttpServerBuilderdelegate()Returns theHttpServerBuilderdelegate.drainRequestPayloadBody(boolean enable) Configure automatic consumption of requestpayload bodywhen it is not consumed by the service.enableWireLogging(String loggerName, LogLevel logLevel, BooleanSupplier logUserData) Enables wire-logging for this server.executionStrategy(HttpExecutionStrategy strategy) Sets theHttpExecutionStrategyto be used by this server.Sets theExecutorto be used by this server.ioExecutor(IoExecutor ioExecutor) Sets theIoExecutorto be used by this server.lifecycleObserver(HttpLifecycleObserver lifecycleObserver) Sets aHttpLifecycleObserverthat provides visibility into HTTP lifecycle events.listen(HttpService service) Starts this server and returns theHttpServerContextafter the server has been successfully started.listenAndAwait(HttpService service) Starts this server and returns theHttpServerContextafter the server has been successfully started.listenBlocking(BlockingHttpService service) Starts this server and returns theHttpServerContextafter the server has been successfully started.Starts this server and returns theHttpServerContextafter the server has been successfully started.Starts this server and returns theHttpServerContextafter the server has been successfully started.Starts this server and returns theHttpServerContextafter the server has been successfully started.listenService(HttpServiceBase service) Starts this server and returns theHttpServerContextafter the server has been successfully started.listenServiceAndAwait(HttpServiceBase service) Starts this server and returns theHttpServerContextafter the server has been successfully started.listenSocketOption(SocketOption<T> option, T value) Adds aSocketOptionthat is applied to the server socket channel which listens/accepts socket channels.listenStreaming(StreamingHttpService service) Starts this server and returns theHttpServerContextafter the server has been successfully started.Starts this server and returns theHttpServerContextafter the server has been successfully started.protocols(HttpProtocolConfig... protocols) Configurations of various HTTP protocol versions.socketOption(SocketOption<T> option, T value) Adds aSocketOptionthat is applied to connected/accepted socket channels.sslConfig(ServerSslConfig config) Set the SSL/TLS configuration.sslConfig(ServerSslConfig config, boolean acceptInsecureConnections) Set the SSL/TLS configuration and allows to specify if insecure connections should also be allowed.sslConfig(ServerSslConfig defaultConfig, Map<String, ServerSslConfig> sniMap) Set the SSL/TLS and SNI configuration.sslConfig(ServerSslConfig defaultConfig, Map<String, ServerSslConfig> sniMap, int maxClientHelloLength, Duration clientHelloTimeout) Set the SSL/TLS and SNI configuration.toString()transportConfig(TransportConfig transportConfig) Set the transport configuration.transportObserver(TransportObserver transportObserver) Sets aTransportObserverthat provides visibility into transport events.
-
Constructor Details
-
DelegatingHttpServerBuilder
Create a new instance.- Parameters:
delegate-HttpServerBuilderto which all methods are delegated.
-
-
Method Details
-
delegate
Returns theHttpServerBuilderdelegate.- Returns:
- Delegate
HttpServerBuilder.
-
toString
-
protocols
Description copied from interface:HttpServerBuilderConfigurations of various HTTP protocol versions.Note: the order of specified protocols will reflect on priorities for ALPN in case the connections use
HttpServerBuilder.sslConfig(ServerSslConfig).- Specified by:
protocolsin interfaceHttpServerBuilder- Parameters:
protocols-HttpProtocolConfigfor each protocol that should be supported.- Returns:
this.
-
sslConfig
Description copied from interface:HttpServerBuilderSet the SSL/TLS configuration.- Specified by:
sslConfigin interfaceHttpServerBuilder- Parameters:
config- The configuration to use.- Returns:
this.
-
sslConfig
public HttpServerBuilder sslConfig(ServerSslConfig defaultConfig, Map<String, ServerSslConfig> sniMap) Description copied from interface:HttpServerBuilderSet the SSL/TLS and SNI configuration.- Specified by:
sslConfigin interfaceHttpServerBuilder- Parameters:
defaultConfig- The configuration to use if the client certificate's SNI extension isn't present or the SNI hostname doesn't match any values insniMap.sniMap- A map where the keys are matched against the client certificate's SNI extension value in order to provide the correspondingServerSslConfig.- Returns:
this.
-
sslConfig
public HttpServerBuilder sslConfig(ServerSslConfig defaultConfig, Map<String, ServerSslConfig> sniMap, int maxClientHelloLength, Duration clientHelloTimeout) Description copied from interface:HttpServerBuilderSet the SSL/TLS and SNI configuration.- Specified by:
sslConfigin interfaceHttpServerBuilder- Parameters:
defaultConfig- The configuration to use if the client certificate's SNI extension isn't present or the SNI hostname doesn't match any values insniMap.sniMap- A map where the keys are matched against the client certificate's SNI extension value in order to provide the correspondingServerSslConfig.maxClientHelloLength- The maximum length of a ClientHello message in bytes, up to2^24 - 1bytes. Zero (0) disables validation.clientHelloTimeout- The timeout for waiting until ClientHello message is received. Implementations can round the specifiedDurationto full time units, depending on their time granularity.Zero (0)disables timeout.- Returns:
this.
-
sslConfig
Description copied from interface:HttpServerBuilderSet the SSL/TLS configuration and allows to specify if insecure connections should also be allowed.- Specified by:
sslConfigin interfaceHttpServerBuilder- Parameters:
config- The configuration to use.acceptInsecureConnections- if non-TLS connections are accepted on the same socket.- Returns:
this.
-
transportConfig
Description copied from interface:HttpServerBuilderSet the transport configuration.- Specified by:
transportConfigin interfaceHttpServerBuilder- Parameters:
transportConfig-TransportConfigto use.- Returns:
this.- See Also:
-
socketOption
Description copied from interface:HttpServerBuilderAdds aSocketOptionthat is applied to connected/accepted socket channels.- Specified by:
socketOptionin interfaceHttpServerBuilder- Type Parameters:
T- the type of the value.- Parameters:
option- the option to apply.value- the value.- Returns:
this.- See Also:
-
listenSocketOption
Description copied from interface:HttpServerBuilderAdds aSocketOptionthat is applied to the server socket channel which listens/accepts socket channels.- Specified by:
listenSocketOptionin interfaceHttpServerBuilder- Type Parameters:
T- the type of the value.- Parameters:
option- the option to apply.value- the value.- Returns:
this.- See Also:
-
enableWireLogging
public HttpServerBuilder enableWireLogging(String loggerName, LogLevel logLevel, BooleanSupplier logUserData) Description copied from interface:HttpServerBuilderEnables wire-logging for this server.- Specified by:
enableWireLoggingin interfaceHttpServerBuilder- Parameters:
loggerName- The name of the logger to log wire events.logLevel- The level to log at.logUserData-trueto include user data (e.g. data, headers, etc.).falseto exclude user data and log only network events. This method is invoked for each data object allowing for dynamic behavior.- Returns:
this.
-
transportObserver
Description copied from interface:HttpServerBuilderSets aTransportObserverthat provides visibility into transport events.- Specified by:
transportObserverin interfaceHttpServerBuilder- Parameters:
transportObserver- ATransportObserverthat provides visibility into transport events.- Returns:
this.
-
lifecycleObserver
Description copied from interface:HttpServerBuilderSets aHttpLifecycleObserverthat provides visibility into HTTP lifecycle events.This method allows setting a
HttpLifecycleObserverin a position that captures entire state of the execution chain, including all filters and internal post-processing. If it's necessary to observe an exchange after other filters or apply it conditionally, consider usingio.servicetalk.http.netty.HttpLifecycleObserverServiceFilterinstead.- Specified by:
lifecycleObserverin interfaceHttpServerBuilder- Parameters:
lifecycleObserver- AHttpLifecycleObserverthat provides visibility into HTTP lifecycle events.- Returns:
this.
-
drainRequestPayloadBody
Description copied from interface:HttpServerBuilderConfigure automatic consumption of requestpayload bodywhen it is not consumed by the service.For persistent HTTP connections it is required to eventually consume the entire request payload to enable reading of the next request. This is required because requests are pipelined for HTTP/1.1, so if the previous request is not completely read, next request can not be read from the socket. For cases when there is a possibility that user may forget to consume request payload, ServiceTalk automatically consumes request payload body. This automatic consumption behavior may create some overhead and can be disabled using this method when it is guaranteed that all request paths consumes all request payloads eventually. An example of guaranteed consumption are
non-streaming APIs.- Specified by:
drainRequestPayloadBodyin interfaceHttpServerBuilder- Parameters:
enable- Whenfalseit will disable the automatic consumption of requestStreamingHttpRequest.payloadBody().- Returns:
this.
-
allowDropRequestTrailers
Description copied from interface:HttpServerBuilderProvide a hint if request trailers are allowed to be dropped. This hint maybe ignored if the transport can otherwise infer that the trailers should be preserved. For example, if the request headers contain Trailer then this hint maybe ignored.- Specified by:
allowDropRequestTrailersin interfaceHttpServerBuilder- Parameters:
allowDrop-trueif request trailers are allowed to be dropped.- Returns:
this
-
appendConnectionAcceptorFilter
Description copied from interface:HttpServerBuilderAppends the filter to the chain of filters used to decorate theConnectionAcceptorused by this builder.The order of execution of these filters are in order of append. If 3 filters are added as follows:
builder .appendConnectionAcceptorFilter(filter1) .appendConnectionAcceptorFilter(filter2) .appendConnectionAcceptorFilter(filter3)accepting a connection by a filter wrapped by this filter chain, the order of invocation of these filters will be:filter1 ⇒ filter2 ⇒ filter3The connection acceptor will, by default, not be offloaded. If your filter requires the
ConnectionAcceptor.accept(ConnectionContext)to be offloaded then yourConnectionAcceptorFactorywill need to returnConnectExecutionStrategy.offloadAll()from theExecutionStrategyInfluencer.requiredOffloads().- Specified by:
appendConnectionAcceptorFilterin interfaceHttpServerBuilder- Parameters:
factory-ConnectionAcceptorFactoryto append. Lifetime of thisConnectionAcceptorFactoryis managed by this builder and the server started thereof.- Returns:
this
-
appendEarlyConnectionAcceptor
Description copied from interface:HttpServerBuilderAppends theEarlyConnectionAcceptorto be called when a new connection has been created.The difference between the
EarlyConnectionAcceptorand theLateConnectionAcceptoris that the early one is called right after the connection has been accepted - and most importantly - before any TLS handshake has been performed. This allows to terminate connections quickly and spend less CPU resources if the amount of information provided to make such a decision is sufficient.The order of execution of these acceptors are in order of append. If 3 acceptors are added as follows:
builder .appendEarlyConnectionAcceptor(acceptor1) .appendEarlyConnectionAcceptor(acceptor2) .appendEarlyConnectionAcceptor(acceptor3)the order of invocation of these filters will be:acceptor1 ⇒ acceptor2 ⇒ acceptor3The acceptor is offloaded by default. If an acceptor in the chain fails the
Completable, the later ones will not be called.- Specified by:
appendEarlyConnectionAcceptorin interfaceHttpServerBuilder- Parameters:
factory- the acceptor to append to the chain of acceptors.- Returns:
- this
HttpServerBuilderfor chaining purposes. - See Also:
-
appendLateConnectionAcceptor
Description copied from interface:HttpServerBuilderAppends theLateConnectionAcceptorto be called when a new connection has been created.The
LateConnectionAcceptor(compared to theEarlyConnectionAcceptor) gets called later in the connection establishment process. Instead of being invoked right after the connection has been accepted, this acceptor gets called after the connection is fully initialized, the TLS handshake has been completed and as a result has more contextual information available in theConnectionInfo.The order of execution of these acceptors are in order of append. If 3 acceptors are added as follows:
builder .appendLateConnectionAcceptor(acceptor1) .appendLateConnectionAcceptor(acceptor2) .appendLateConnectionAcceptor(acceptor3)the order of invocation of these filters will be:acceptor1 ⇒ acceptor2 ⇒ acceptor3The acceptor is offloaded by default. If an acceptor in the chain fails the
Completable, the later ones will not be called.- Specified by:
appendLateConnectionAcceptorin interfaceHttpServerBuilder- Parameters:
factory- the acceptor to append to the chain of acceptors.- Returns:
- this
HttpServerBuilderfor chaining purposes. - See Also:
-
appendNonOffloadingServiceFilter
public HttpServerBuilder appendNonOffloadingServiceFilter(StreamingHttpServiceFilterFactory factory) Description copied from interface:HttpServerBuilderAppends a non-offloading filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder.Note this method will be used to decorate the
StreamingHttpServicepassed toHttpServerBuilder.listenStreaming(StreamingHttpService)before it is used by the server.The order of execution of these filters are in order of append, before the filters added with
HttpServerBuilder.appendServiceFilter(StreamingHttpServiceFilterFactory). If 3 filters are added as follows:builder .appendServiceFilter(filter1) .appendNonOffloadingServiceFilter(filter2) .appendServiceFilter(filter3)accepting a request by a service wrapped by this filter chain, the order of invocation of these filters will be:filter2 ⇒ [offloading] ⇒ filter1 ⇒ filter3 ⇒ service- Specified by:
appendNonOffloadingServiceFilterin interfaceHttpServerBuilder- Parameters:
factory-StreamingHttpServiceFilterFactoryto append.- Returns:
this
-
appendNonOffloadingServiceFilter
public HttpServerBuilder appendNonOffloadingServiceFilter(Predicate<StreamingHttpRequest> predicate, StreamingHttpServiceFilterFactory factory) Description copied from interface:HttpServerBuilderAppends a non-offloading filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder, for every request that passes the providedPredicate. Filters added via this method will be executed before offloading occurs and before filters appended viaHttpServerBuilder.appendServiceFilter(StreamingHttpServiceFilterFactory).Note this method will be used to decorate the
StreamingHttpServicepassed toHttpServerBuilder.listenStreaming(StreamingHttpService)before it is used by the server. The order of execution of these filters are in order of append, before the filters added withHttpServerBuilder.appendServiceFilter(StreamingHttpServiceFilterFactory). If 3 filters are added as follows:builder .appendServiceFilter(filter1) .appendNonOffloadingServiceFilter(filter2) .appendServiceFilter(filter3)accepting a request by a service wrapped by this filter chain, the order of invocation of these filters will be:filter2 ⇒ [offloading] ⇒ filter1 ⇒ filter3 ⇒ service- Specified by:
appendNonOffloadingServiceFilterin interfaceHttpServerBuilder- Parameters:
predicate- thePredicateto test if the filter must be applied. This must not block.factory-StreamingHttpServiceFilterFactoryto append.- Returns:
this
-
appendServiceFilter
Description copied from interface:HttpServerBuilderAppends the filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder.Note this method will be used to decorate the
StreamingHttpServicepassed toHttpServerBuilder.listenStreaming(StreamingHttpService)before it is used by the server.The order of execution of these filters are in order of append. If 3 filters are added as follows:
builder.appendServiceFilter(filter1).appendServiceFilter(filter2).appendServiceFilter(filter3)accepting a request by a service wrapped by this filter chain, the order of invocation of these filters will be:filter1 ⇒ filter2 ⇒ filter3 ⇒ service- Specified by:
appendServiceFilterin interfaceHttpServerBuilder- Parameters:
factory-StreamingHttpServiceFilterFactoryto append.- Returns:
this
-
appendServiceFilter
public HttpServerBuilder appendServiceFilter(Predicate<StreamingHttpRequest> predicate, StreamingHttpServiceFilterFactory factory) Description copied from interface:HttpServerBuilderAppends the filter to the chain of filters used to decorate theStreamingHttpServiceused by this builder, for every request that passes the providedPredicate.Note this method will be used to decorate the
StreamingHttpServicepassed toHttpServerBuilder.listenStreaming(StreamingHttpService)before it is used by the server.The order of execution of these filters are in order of append. If 3 filters are added as follows:
builder.appendServiceFilter(filter1).appendServiceFilter(filter2).appendServiceFilter(filter3)accepting a request by a service wrapped by this filter chain, the order of invocation of these filters will be:filter1 ⇒ filter2 ⇒ filter3 ⇒ service- Specified by:
appendServiceFilterin interfaceHttpServerBuilder- Parameters:
predicate- thePredicateto test if the filter must be applied. This must not block.factory-StreamingHttpServiceFilterFactoryto append.- Returns:
this
-
ioExecutor
Description copied from interface:HttpServerBuilderSets theIoExecutorto be used by this server.- Specified by:
ioExecutorin interfaceHttpServerBuilder- Parameters:
ioExecutor-IoExecutorto use.- Returns:
this.
-
executor
Description copied from interface:HttpServerBuilderSets theExecutorto be used by this server.- Specified by:
executorin interfaceHttpServerBuilder- Parameters:
executor-Executorto use.- Returns:
this.
-
bufferAllocator
Description copied from interface:HttpServerBuilderSets theBufferAllocatorto be used by this server.- Specified by:
bufferAllocatorin interfaceHttpServerBuilder- Parameters:
allocator-BufferAllocatorto use.- Returns:
this.
-
executionStrategy
Description copied from interface:HttpServerBuilderSets theHttpExecutionStrategyto be used by this server.- Specified by:
executionStrategyin interfaceHttpServerBuilder- Parameters:
strategy-HttpExecutionStrategyto use by this server.- Returns:
this.
-
listenService
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.Note that this method is generic in the sense that it accepts all HTTP
HttpServiceBaseimplementations to be passed in, namelyStreamingHttpService,HttpService,BlockingStreamingHttpServiceandBlockingHttpService. It is especially useful when Dependency Injection is used and the type of service is not known at compile time.- Specified by:
listenServicein interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- 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:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
Singlethat completes when the server is successfully started or terminates with an error if the server could not be started.
-
listenStreaming
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenStreamingin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
Singlethat completes when the server is successfully started or terminates with an error if the server could not be started.
-
listenBlocking
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenBlockingin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
Singlethat completes when the server is successfully started or terminates with an error if the server could not be started.
-
listenBlockingStreaming
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenBlockingStreamingin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
Singlethat completes when the server is successfully started or terminates with an error if the server could not be started.
-
listenServiceAndAwait
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.Note that this method is generic in the sense that it accepts all HTTP
HttpServiceBaseimplementations to be passed in, namelyStreamingHttpService,HttpService,BlockingStreamingHttpServiceandBlockingHttpService. It is especially useful when Dependency Injection is used and the type of service is not known at compile time.- Specified by:
listenServiceAndAwaitin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
HttpServerContextby blocking the calling thread until the server is successfully started or throws anExceptionif the server could not be started. - Throws:
IllegalArgumentException- if an unsupportedHttpServiceBasetype is being provided.Exception- if the server could not be started.
-
listenAndAwait
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenAndAwaitin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
HttpServerContextby 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.
-
listenStreamingAndAwait
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenStreamingAndAwaitin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
HttpServerContextby 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.
-
listenBlockingAndAwait
Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenBlockingAndAwaitin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
HttpServerContextby 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.
-
listenBlockingStreamingAndAwait
public HttpServerContext listenBlockingStreamingAndAwait(BlockingStreamingHttpService service) throws Exception Description copied from interface:HttpServerBuilderStarts this server and returns theHttpServerContextafter the server has been successfully started.If the underlying protocol (e.g. TCP) supports it this will result in a socket bind/listen on
address.- Specified by:
listenBlockingStreamingAndAwaitin interfaceHttpServerBuilder- Parameters:
service- Service invoked for every request received by this server. The returnedHttpServerContextmanages the lifecycle of theservice, ensuring it is closed when theHttpServerContextis closed.- Returns:
- A
HttpServerContextby 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.
-