public abstract class AbstractServerBuilder<I,O,T extends io.netty.bootstrap.AbstractBootstrap<T,C>,C extends io.netty.channel.Channel,B extends AbstractServerBuilder,S extends AbstractServer<I,O,T,C,S>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ConnectionHandler<I,O> |
connectionHandler |
protected io.netty.util.concurrent.EventExecutorGroup |
eventExecutorGroup |
protected MetricEventsListenerFactory |
eventListenersFactory |
protected PipelineConfigurator<I,O> |
pipelineConfigurator |
protected int |
port |
protected T |
serverBootstrap |
protected java.lang.Class<? extends C> |
serverChannelClass |
protected SSLEngineFactory |
sslEngineFactory |
protected io.netty.handler.logging.LogLevel |
wireLogginLevel |
Modifier | Constructor and Description |
---|---|
protected |
AbstractServerBuilder(int port,
T bootstrap,
ConnectionHandler<I,O> connectionHandler) |
Modifier and Type | Method and Description |
---|---|
B |
appendPipelineConfigurator(PipelineConfigurator<I,O> additionalConfigurator) |
S |
build() |
B |
channel(java.lang.Class<? extends C> serverChannelClass) |
<P> B |
channelOption(io.netty.channel.ChannelOption<P> option,
P value) |
protected void |
configureDefaultEventloopGroup() |
protected abstract S |
createServer() |
B |
defaultChannelOptions() |
protected abstract java.lang.Class<? extends C> |
defaultServerChannelClass() |
B |
enableWireLogging(io.netty.handler.logging.LogLevel wireLogginLevel)
Enables wire level logs (all events received by netty) to be logged at the passed
wireLogginLevel . |
B |
eventLoop(io.netty.channel.EventLoopGroup singleGroup) |
PipelineConfigurator<I,O> |
getPipelineConfigurator() |
protected abstract MetricEventsListener<? extends ServerMetricsEvent<? extends java.lang.Enum>> |
newMetricsListener(MetricEventsListenerFactory factory,
S server) |
B |
pipelineConfigurator(PipelineConfigurator<I,O> pipelineConfigurator) |
protected B |
returnBuilder() |
B |
withEventExecutorGroup(io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup)
If the passed executor is not
null , the configured ConnectionHandler will be invoked in
the passed EventExecutorGroup |
B |
withMetricEventsListenerFactory(MetricEventsListenerFactory eventListenersFactory) |
B |
withSslEngineFactory(SSLEngineFactory sslEngineFactory) |
protected PipelineConfigurator<I,O> pipelineConfigurator
protected java.lang.Class<? extends C extends io.netty.channel.Channel> serverChannelClass
protected final ConnectionHandler<I,O> connectionHandler
protected final int port
protected io.netty.handler.logging.LogLevel wireLogginLevel
protected MetricEventsListenerFactory eventListenersFactory
protected io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup
protected SSLEngineFactory sslEngineFactory
protected AbstractServerBuilder(int port, T bootstrap, ConnectionHandler<I,O> connectionHandler)
public B eventLoop(io.netty.channel.EventLoopGroup singleGroup)
public <P> B channelOption(io.netty.channel.ChannelOption<P> option, P value)
public B pipelineConfigurator(PipelineConfigurator<I,O> pipelineConfigurator)
public B appendPipelineConfigurator(PipelineConfigurator<I,O> additionalConfigurator)
public B withSslEngineFactory(SSLEngineFactory sslEngineFactory)
public B enableWireLogging(io.netty.handler.logging.LogLevel wireLogginLevel)
wireLogginLevel
. LogLevel.WARN
or
LogLevel.ERROR
, if this wire level logging is required for all requests (not at all recommended as this
logging is very verbose), the passed level must be LogLevel.WARN
or LogLevel.ERROR
respectively. LogLevel.DEBUG
and then dynamically enabled disable this log level
whenever required. wireLogginLevel
- Log level at which the wire level logs will be logged.LoggingHandler
public B defaultChannelOptions()
public B withMetricEventsListenerFactory(MetricEventsListenerFactory eventListenersFactory)
public B withEventExecutorGroup(io.netty.util.concurrent.EventExecutorGroup eventExecutorGroup)
null
, the configured ConnectionHandler
will be invoked in
the passed EventExecutorGroup
eventExecutorGroup
- The EventExecutorGroup
in which to invoke the configured
ConnectionHandler
. Can be null
, in which case, the
ConnectionHandler
is invoked in the channel's eventloop.public PipelineConfigurator<I,O> getPipelineConfigurator()
public S build()
protected void configureDefaultEventloopGroup()
protected abstract java.lang.Class<? extends C> defaultServerChannelClass()
protected abstract S createServer()
protected abstract MetricEventsListener<? extends ServerMetricsEvent<? extends java.lang.Enum>> newMetricsListener(MetricEventsListenerFactory factory, S server)
protected B returnBuilder()