BOOTSTRAP - A Netty Bootstrap typeSO - A NettyOptions subclasspublic abstract class NettyOptions<BOOTSTRAP extends AbstractBootstrap<BOOTSTRAP,?>,SO extends NettyOptions<BOOTSTRAP,SO>>
extends java.lang.Object
implements java.util.function.Supplier<BOOTSTRAP>
| Modifier and Type | Class and Description |
|---|---|
static class |
NettyOptions.Builder<BOOTSTRAP extends AbstractBootstrap<BOOTSTRAP,?>,SO extends NettyOptions<BOOTSTRAP,SO>,BUILDER extends NettyOptions.Builder<BOOTSTRAP,SO,BUILDER>> |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.function.Consumer<? super Channel> |
afterChannelInit |
protected java.util.function.Consumer<? super NettyContext> |
afterNettyContextInit |
static int |
DEFAULT_PORT
The default port for reactor-netty servers.
|
| Modifier | Constructor and Description |
|---|---|
protected |
NettyOptions(NettyOptions.Builder<BOOTSTRAP,SO,?> builder) |
| Modifier and Type | Method and Description |
|---|---|
java.util.function.Consumer<? super Channel> |
afterChannelInit()
Returns the callback for post
Channel initialization and reactor-netty
pipeline handlers registration. |
java.util.function.Consumer<? super NettyContext> |
afterNettyContextInit()
Returns the callback for post
Channel initialization, reactor-netty
pipeline handlers registration and NettyContext initialisation. |
java.lang.String |
asDetailedString() |
java.lang.String |
asSimpleString() |
protected SslContext |
defaultSslContext()
Default Ssl context if none configured or null;
|
abstract SO |
duplicate()
Return a copy of all options and references such as
NettyOptions.Builder.onChannelInit(Predicate). |
BOOTSTRAP |
get() |
abstract java.net.SocketAddress |
getAddress()
Return a new eventual
SocketAddress |
LoopResources |
getLoopResources()
Get the configured Loop Resources if any
|
SslHandler |
getSslHandler(ByteBufAllocator allocator,
Tuple2<java.lang.String,java.lang.Integer> sniInfo)
Return a new eventual
SslHandler, optionally with SNI activated |
boolean |
isSecure()
Checks if these options denotes secured communication, ie.
|
java.util.function.Predicate<? super Channel> |
onChannelInit()
Returns the predicate used to validate each
Channel post initialization
(but before reactor-netty pipeline handlers have been registered). |
boolean |
preferNative()
Is this option preferring native loops (epoll/kqueue)
|
long |
sslCloseNotifyFlushTimeoutMillis()
Returns the SSL close_notify flush timeout in millis
|
long |
sslCloseNotifyReadTimeoutMillis()
Returns the SSL close_notify read timeout in millis
|
SslContext |
sslContext()
Returns the SslContext
|
long |
sslHandshakeTimeoutMillis()
Returns the SSL handshake timeout in millis
|
java.lang.String |
toString() |
public static final int DEFAULT_PORT
PORT environment variable.protected final java.util.function.Consumer<? super Channel> afterChannelInit
protected final java.util.function.Consumer<? super NettyContext> afterNettyContextInit
protected NettyOptions(NettyOptions.Builder<BOOTSTRAP,SO,?> builder)
public final java.util.function.Consumer<? super Channel> afterChannelInit()
Channel initialization and reactor-netty
pipeline handlers registration.onChannelInit(),
afterNettyContextInit()public final java.util.function.Consumer<? super NettyContext> afterNettyContextInit()
Channel initialization, reactor-netty
pipeline handlers registration and NettyContext initialisation.NettyContext setup handleronChannelInit(),
afterChannelInit()public boolean isSecure()
SSLContext
was set other than the default one.public abstract SO duplicate()
NettyOptions.Builder.onChannelInit(Predicate). Further option uses on the returned builder will
be fully isolated from this option builder.public BOOTSTRAP get()
get in interface java.util.function.Supplier<BOOTSTRAP extends AbstractBootstrap<BOOTSTRAP,?>>public abstract java.net.SocketAddress getAddress()
SocketAddressSocketAddress or nullpublic final LoopResources getLoopResources()
LoopResourcespublic final SslHandler getSslHandler(ByteBufAllocator allocator, Tuple2<java.lang.String,java.lang.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 post initialization
(but before reactor-netty pipeline handlers have been registered).afterChannelInit(),
afterNettyContextInit()public final boolean preferNative()
public final SslContext sslContext()
public final long sslHandshakeTimeoutMillis()
public final long sslCloseNotifyFlushTimeoutMillis()
public final long sslCloseNotifyReadTimeoutMillis()
protected SslContext defaultSslContext()
SslContextpublic java.lang.String asSimpleString()
public java.lang.String asDetailedString()
public java.lang.String toString()
toString in class java.lang.Object