public class HttpServerBuilder<I,O> extends ConnectionBasedServerBuilder<HttpServerRequest<I>,HttpServerResponse<O>,HttpServerBuilder<I,O>>
HttpServer
connectionHandler, eventExecutorGroup, eventListenersFactory, pipelineConfigurator, port, serverBootstrap, serverChannelClass, sslEngineFactory, wireLogginLevel
Constructor and Description |
---|
HttpServerBuilder(int port,
RequestHandler<I,O> requestHandler) |
HttpServerBuilder(int port,
RequestHandler<I,O> requestHandler,
boolean send10ResponseFor10Request) |
HttpServerBuilder(io.netty.bootstrap.ServerBootstrap bootstrap,
int port,
RequestHandler<I,O> requestHandler) |
HttpServerBuilder(io.netty.bootstrap.ServerBootstrap bootstrap,
int port,
RequestHandler<I,O> requestHandler,
boolean send10ResponseFor10Request) |
Modifier and Type | Method and Description |
---|---|
HttpServer<I,O> |
build() |
protected HttpServer<I,O> |
createServer() |
protected MetricEventsListener<ServerMetricsEvent<?>> |
newMetricsListener(MetricEventsListenerFactory factory,
RxServer<HttpServerRequest<I>,HttpServerResponse<O>> server) |
HttpServerBuilder<I,O> |
withEventExecutorGroup(io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup)
If the passed executor is not
null , the configured RequestHandler will be invoked in the passed
EventExecutorGroup |
HttpServerBuilder<I,O> |
withRequestContentSubscriptionTimeout(long subscriptionTimeout,
java.util.concurrent.TimeUnit timeunit)
HttpServerRequest does not allow unlimited delayed content subscriptions. |
HttpServerBuilder<I,O> |
withRequestProcessingThreads(int threadCount)
Same as calling
withRequestProcessingThreads(int, ThreadFactory) with RxDefaultThreadFactory |
HttpServerBuilder<I,O> |
withRequestProcessingThreads(int threadCount,
java.util.concurrent.ThreadFactory factory)
Same as calling
withEventExecutorGroup(EventExecutorGroup) with DefaultEventExecutorGroup using
the passed factory |
childChannelOption, configureDefaultEventloopGroup, defaultChannelOptions, defaultServerChannelClass, eventLoops
appendPipelineConfigurator, channel, channelOption, enableWireLogging, eventLoop, getPipelineConfigurator, pipelineConfigurator, returnBuilder, withMetricEventsListenerFactory, withSslEngineFactory
public HttpServerBuilder(int port, RequestHandler<I,O> requestHandler, boolean send10ResponseFor10Request)
public HttpServerBuilder(io.netty.bootstrap.ServerBootstrap bootstrap, int port, RequestHandler<I,O> requestHandler)
public HttpServerBuilder(int port, RequestHandler<I,O> requestHandler)
public HttpServerBuilder(io.netty.bootstrap.ServerBootstrap bootstrap, int port, RequestHandler<I,O> requestHandler, boolean send10ResponseFor10Request)
public HttpServerBuilder<I,O> withEventExecutorGroup(io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup)
null
, the configured RequestHandler
will be invoked in the passed
EventExecutorGroup
withEventExecutorGroup
in class AbstractServerBuilder<HttpServerRequest<I>,HttpServerResponse<O>,io.netty.bootstrap.ServerBootstrap,io.netty.channel.ServerChannel,HttpServerBuilder<I,O>,RxServer<HttpServerRequest<I>,HttpServerResponse<O>>>
eventExecutorGroup
- The EventExecutorGroup
in which to invoke the configured
RequestHandler
. Can be null
, in which case, the
RequestHandler
is invoked in the channel's eventloop.public HttpServerBuilder<I,O> withRequestProcessingThreads(int threadCount)
withRequestProcessingThreads(int, ThreadFactory)
with RxDefaultThreadFactory
threadCount
- Number of threads to use for request processing.public HttpServerBuilder<I,O> withRequestProcessingThreads(int threadCount, java.util.concurrent.ThreadFactory factory)
withEventExecutorGroup(EventExecutorGroup)
with DefaultEventExecutorGroup
using
the passed factory
threadCount
- Number of threads to use for request processing.factory
- Thread factory to use for the DefaultEventExecutorGroup
public HttpServerBuilder<I,O> withRequestContentSubscriptionTimeout(long subscriptionTimeout, java.util.concurrent.TimeUnit timeunit)
HttpServerRequest
does not allow unlimited delayed content subscriptions.
This method specifies the timeout for the subscription of the content.subscriptionTimeout
- Timeout value.timeunit
- Timeout time unit.public HttpServer<I,O> build()
build
in class AbstractServerBuilder<HttpServerRequest<I>,HttpServerResponse<O>,io.netty.bootstrap.ServerBootstrap,io.netty.channel.ServerChannel,HttpServerBuilder<I,O>,RxServer<HttpServerRequest<I>,HttpServerResponse<O>>>
protected HttpServer<I,O> createServer()
createServer
in class AbstractServerBuilder<HttpServerRequest<I>,HttpServerResponse<O>,io.netty.bootstrap.ServerBootstrap,io.netty.channel.ServerChannel,HttpServerBuilder<I,O>,RxServer<HttpServerRequest<I>,HttpServerResponse<O>>>
protected MetricEventsListener<ServerMetricsEvent<?>> newMetricsListener(MetricEventsListenerFactory factory, RxServer<HttpServerRequest<I>,HttpServerResponse<O>> server)
newMetricsListener
in class AbstractServerBuilder<HttpServerRequest<I>,HttpServerResponse<O>,io.netty.bootstrap.ServerBootstrap,io.netty.channel.ServerChannel,HttpServerBuilder<I,O>,RxServer<HttpServerRequest<I>,HttpServerResponse<O>>>