public abstract class BootstrapHandlers extends Object
Bootstrap
and
ServerBootstrap
handlersModifier and Type | Method and Description |
---|---|
static ChannelOperations.OnSetup |
channelOperationFactory(AbstractBootstrap<?,?> b)
Obtain and remove the current
ChannelOperations.OnSetup from the bootstrap. |
static void |
channelOperationFactory(AbstractBootstrap<?,?> b,
ChannelOperations.OnSetup opsFactory)
Set a
ChannelOperations.OnSetup to the passed bootstrap. |
static ConnectionObserver |
childConnectionObserver(ServerBootstrap b)
Obtain and remove the current childHandler
ConnectionObserver from the
bootstrap. |
static void |
childConnectionObserver(ServerBootstrap b,
ConnectionObserver connectionObserver)
Add a childHandler
ConnectionObserver to the passed bootstrap. |
static ConnectionObserver |
connectionObserver(AbstractBootstrap<?,?> b)
Obtain and remove the current
ConnectionObserver from the bootstrap. |
static void |
connectionObserver(AbstractBootstrap<?,?> b,
ConnectionObserver connectionObserver)
Add a
ConnectionObserver to the passed bootstrap. |
static void |
finalizeHandler(Bootstrap b,
ChannelOperations.OnSetup opsFactory,
ConnectionObserver listener)
Finalize a bootstrap pipeline configuration by turning it into a
ChannelInitializer to safely initialize each child channel. |
static void |
finalizeHandler(ServerBootstrap b,
ChannelOperations.OnSetup opsFactory,
ConnectionObserver childListener)
Finalize a server bootstrap pipeline configuration by turning it into a
ChannelInitializer to safely initialize each child channel. |
static <C> C |
findConfiguration(Class<C> clazz,
ChannelHandler handler)
Find the given typed configuration consumer or return null;
|
static Bootstrap |
removeConfiguration(Bootstrap b,
String name)
Remove a configuration given its unique name from the given
Bootstrap |
static ServerBootstrap |
removeConfiguration(ServerBootstrap b,
String name)
Remove a configuration given its unique name from the given
ServerBootstrap |
static Bootstrap |
updateConfiguration(Bootstrap b,
String name,
java.util.function.BiConsumer<ConnectionObserver,? super Channel> c)
Add the configuration consumer to this
Bootstrap given a unique
configuration name. |
static Bootstrap |
updateConfiguration(Bootstrap b,
String name,
java.util.function.Function<? super Bootstrap,? extends java.util.function.BiConsumer<ConnectionObserver,? super Channel>> c)
Add the configuration consumer to this
Bootstrap given a unique
configuration name. |
static ServerBootstrap |
updateConfiguration(ServerBootstrap b,
String name,
java.util.function.BiConsumer<ConnectionObserver,? super Channel> c)
Add the configuration consumer to this
ServerBootstrap given a unique
configuration name. |
static Bootstrap |
updateLogSupport(Bootstrap b,
LoggingHandler handler)
Configure log support for a
Bootstrap |
static Bootstrap |
updateLogSupport(Bootstrap b,
String category,
LogLevel level)
Configure log support for a
Bootstrap |
static ServerBootstrap |
updateLogSupport(ServerBootstrap b,
LoggingHandler handler)
Configure log support for a
ServerBootstrap |
public static void finalizeHandler(ServerBootstrap b, ChannelOperations.OnSetup opsFactory, ConnectionObserver childListener)
ChannelInitializer
to safely initialize each child channel.b
- a server bootstrapopsFactory
- an operation factorychildListener
- a connection observerpublic static void finalizeHandler(Bootstrap b, ChannelOperations.OnSetup opsFactory, ConnectionObserver listener)
ChannelInitializer
to safely initialize each child channel.b
- a bootstrapopsFactory
- an operation factorylistener
- a connection observer@Nullable public static <C> C findConfiguration(Class<C> clazz, @Nullable ChannelHandler handler)
C
- configuration consumer typeclazz
- the type of configuration to findhandler
- optional handler to scanpublic static ServerBootstrap removeConfiguration(ServerBootstrap b, String name)
ServerBootstrap
b
- a server bootstrapname
- a configuration namepublic static Bootstrap removeConfiguration(Bootstrap b, String name)
Bootstrap
b
- a bootstrapname
- a configuration namepublic static void channelOperationFactory(AbstractBootstrap<?,?> b, ChannelOperations.OnSetup opsFactory)
ChannelOperations.OnSetup
to the passed bootstrap.b
- the bootstrap to scanopsFactory
- a new ChannelOperations.OnSetup
factorypublic static ChannelOperations.OnSetup channelOperationFactory(AbstractBootstrap<?,?> b)
ChannelOperations.OnSetup
from the bootstrap.b
- the bootstrap to scanChannelOperations.OnSetup
factory or nullpublic static void connectionObserver(AbstractBootstrap<?,?> b, ConnectionObserver connectionObserver)
ConnectionObserver
to the passed bootstrap.b
- the bootstrap to scanconnectionObserver
- a new ConnectionObserver
public static ConnectionObserver connectionObserver(AbstractBootstrap<?,?> b)
ConnectionObserver
from the bootstrap.b
- the bootstrap to scanConnectionObserver
or nullpublic static void childConnectionObserver(ServerBootstrap b, ConnectionObserver connectionObserver)
ConnectionObserver
to the passed bootstrap.b
- the bootstrap to scanconnectionObserver
- a new ConnectionObserver
public static ConnectionObserver childConnectionObserver(ServerBootstrap b)
ConnectionObserver
from the
bootstrap.b
- the bootstrap to scanConnectionObserver
or nullpublic static Bootstrap updateConfiguration(Bootstrap b, String name, java.util.function.BiConsumer<ConnectionObserver,? super Channel> c)
Bootstrap
given a unique
configuration name. Configuration will be run on channel init.b
- a bootstrapname
- a configuration namec
- a configuration consumerpublic static Bootstrap updateConfiguration(Bootstrap b, String name, java.util.function.Function<? super Bootstrap,? extends java.util.function.BiConsumer<ConnectionObserver,? super Channel>> c)
Bootstrap
given a unique
configuration name. Configuration will be run on channel init.b
- a bootstrapname
- a configuration namec
- a deferred configuration consumerpublic static ServerBootstrap updateConfiguration(ServerBootstrap b, String name, java.util.function.BiConsumer<ConnectionObserver,? super Channel> c)
ServerBootstrap
given a unique
configuration name. Configuration will be run on child channel init.b
- a server bootstrapname
- a configuration namec
- a configuration consumerpublic static Bootstrap updateLogSupport(Bootstrap b, LoggingHandler handler)
Bootstrap
b
- the bootstrap to setuphandler
- the logging handler to setupBootstrap
public static Bootstrap updateLogSupport(Bootstrap b, String category, LogLevel level)
Bootstrap
b
- the bootstrap to setupcategory
- the logger categorylevel
- the logger levelBootstrap
public static ServerBootstrap updateLogSupport(ServerBootstrap b, LoggingHandler handler)
ServerBootstrap
b
- the bootstrap to setuphandler
- the logging handler to setupServerBootstrap