BOOSTRAP - A Netty Bootstrap typeSO - A NettyOptions subclasspublic abstract class NettyOptions<BOOSTRAP extends AbstractBootstrap<BOOSTRAP,?>,SO extends NettyOptions<BOOSTRAP,SO>> extends Object implements java.util.function.Supplier<BOOSTRAP>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
The default port for reactor-netty servers.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.function.Consumer<? super Channel> |
afterChannelInit()
Returns the callback after each
Channel initialization and after
reactor-netty
pipeline handlers have been registered. |
SO |
afterChannelInit(java.util.function.Consumer<? super Channel> afterChannelInit)
Setup the callback after each
Channel initialization and after
reactor-netty
pipeline handlers have been registered. |
<T> SO |
attr(AttributeKey<T> key,
T value)
Attribute default attribute to the future
Channel connection. |
SO |
channelGroup(ChannelGroup channelGroup)
Provide a
ChannelGroup for each active remote channel will be held in the
provided group. |
protected SslContext |
defaultSslContext()
Default Ssl context if none configured or null;
|
abstract SO |
duplicate()
Return a copy of all options and references such as
onChannelInit(Predicate). |
SO |
eventLoopGroup(EventLoopGroup eventLoopGroup)
Provide a shared
EventLoopGroup each Connector handler. |
BOOSTRAP |
get() |
abstract SocketAddress |
getAddress()
Return a new eventual
SocketAddress |
LoopResources |
getLoopResources()
Get the configured Loop Resources if any
|
SslHandler |
getSslHandler(ByteBufAllocator allocator,
Tuple2<String,Integer> sniInfo)
Return a new eventual
SslHandler, optionally with SNI activated |
SO |
loopResources(LoopResources channelResources)
Provide an
EventLoopGroup supplier. |
java.util.function.Predicate<? super Channel> |
onChannelInit()
Returns the callback for each
Channel initialization and before
reactor-netty
pipeline handlers have been registered. |
SO |
onChannelInit(java.util.function.Predicate<? super Channel> onChannelInit)
A callback for each
Channel initialization and before reactor-netty
pipeline handlers have been registered. |
<T> SO |
option(ChannelOption<T> key,
T value)
Set a
ChannelOption value for low level connection settings like
SO_TIMEOUT or SO_KEEPALIVE. |
boolean |
preferNative()
Is this option preferring native loops (epoll)
|
SO |
preferNative(boolean preferNative)
Set the preferred native option.
|
SO |
sslContext(SslContext sslContext)
Set the options to use for configuring SSL.
|
SO |
sslHandshakeTimeout(java.time.Duration sslHandshakeTimeout)
Set the options to use for configuring SSL handshake timeout.
|
SO |
sslHandshakeTimeoutMillis(long sslHandshakeTimeoutMillis)
Set the options to use for configuring SSL handshake timeout.
|
String |
toString() |
public static final int DEFAULT_PORT
PORT environment variable.public final java.util.function.Consumer<? super Channel> afterChannelInit()
Channel initialization and after
reactor-netty
pipeline handlers have been registered.onChannelInit()public SO afterChannelInit(java.util.function.Consumer<? super Channel> afterChannelInit)
Channel initialization and after
reactor-netty
pipeline handlers have been registered.afterChannelInit - the post channel setup handlerthisonChannelInit(Predicate)public <T> SO attr(AttributeKey<T> key, T value)
Channel connection. They will
be available via NettyInbound.attr(AttributeKey).T - the attribute typekey - the attribute keyvalue - the attribute valueAbstractBootstrap.attr(AttributeKey, Object)public SO channelGroup(ChannelGroup channelGroup)
ChannelGroup for each active remote channel will be held in the
provided group.channelGroup - a ChannelGroup to monitor remote channelpublic SO loopResources(LoopResources channelResources)
EventLoopGroup supplier.
Note that server might call it twice for both their selection and io loops.channelResources - a selector accepting native runtime expectation and
returning an eventLoopGrouppublic abstract SO duplicate()
onChannelInit(Predicate). Further option uses on the returned builder will
be fully isolated from this option builder.public SO eventLoopGroup(EventLoopGroup eventLoopGroup)
EventLoopGroup each Connector handler.eventLoopGroup - an eventLoopGroup to shareEventLoopGroup provider given the native runtime expectationpublic BOOSTRAP get()
get in interface java.util.function.Supplier<BOOSTRAP extends AbstractBootstrap<BOOSTRAP,?>>public abstract SocketAddress getAddress()
SocketAddressSocketAddress or nullpublic final LoopResources getLoopResources()
LoopResourcespublic final SslHandler getSslHandler(ByteBufAllocator allocator, Tuple2<String,Integer> sniInfo)
SslHandler, optionally with SNI activatedallocator - ByteBufAllocator to allocate for packet storagesniInfo - Tuple2 with hostname and port for SNI (any null will skip SNI).SslHandler with SNI activatedpublic final java.util.function.Predicate<? super Channel> onChannelInit()
Channel initialization and before
reactor-netty
pipeline handlers have been registered.afterChannelInit()public SO onChannelInit(java.util.function.Predicate<? super Channel> onChannelInit)
Channel initialization and before reactor-netty
pipeline handlers have been registered.onChannelInit - pre channel pipeline setup handlerthisafterChannelInit(Consumer)public <T> SO option(ChannelOption<T> key, T value)
ChannelOption value for low level connection settings like
SO_TIMEOUT or SO_KEEPALIVE. This will apply to each new channel from remote
peer.T - the option typekey - the option keythisAbstractBootstrap.option(ChannelOption, Object)public SO preferNative(boolean preferNative)
preferNative - Should the connector prefer native (epoll) if availablethispublic final boolean preferNative()
public SO sslContext(SslContext sslContext)
null means
don't use SSL at all (the default).sslContext - The context to set when configuring SSLprotected SslContext defaultSslContext()
SslContextpublic SO sslHandshakeTimeout(java.time.Duration sslHandshakeTimeout)
sslHandshakeTimeout - The timeout Durationpublic SO sslHandshakeTimeoutMillis(long sslHandshakeTimeoutMillis)
sslHandshakeTimeoutMillis - The timeout in milliseconds