Class NettyNetworkServerInitializer
java.lang.Object
io.netty5.channel.ChannelInitializer<io.netty5.channel.Channel>
eu.cloudnetservice.driver.impl.network.netty.NettyOptionSettingChannelInitializer
eu.cloudnetservice.driver.impl.network.netty.server.NettyNetworkServerInitializer
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
The default netty based handler responsible to initialize new channels which get connected to the current node.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NettyNetworkServerprivate final eu.cloudnetservice.driver.network.HostAndPort -
Constructor Summary
ConstructorsConstructorDescriptionNettyNetworkServerInitializer(@NonNull NettyNetworkServer networkServer, @NonNull eu.cloudnetservice.driver.network.HostAndPort serverLocalAddress) Constructs a new network initializer instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoInitChannel(@NonNull io.netty5.channel.Channel ch) Method that gets called when the actual channel initialization finished and all requested channel options were activated in the channel.Methods inherited from class NettyOptionSettingChannelInitializer
initChannel, optionMethods inherited from class io.netty5.channel.ChannelInitializer
channelExceptionCaught, handlerAdded, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerRemoved, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
Field Details
-
serverLocalAddress
private final eu.cloudnetservice.driver.network.HostAndPort serverLocalAddress -
networkServer
-
-
Constructor Details
-
NettyNetworkServerInitializer
public NettyNetworkServerInitializer(@NonNull @NonNull NettyNetworkServer networkServer, @NonNull @NonNull eu.cloudnetservice.driver.network.HostAndPort serverLocalAddress) Constructs a new network initializer instance.- Parameters:
networkServer- the network server this handler belongs to.serverLocalAddress- the local address associated with this handler.- Throws:
NullPointerException- if the given event manager, server or address is null.
-
-
Method Details
-
doInitChannel
Method that gets called when the actual channel initialization finished and all requested channel options were activated in the channel. This channel removes the need for overriding classes to callsuper.initChannelin order to get all channel options activated.- Overrides:
doInitChannelin classNettyOptionSettingChannelInitializer- Parameters:
ch- the channel to initialize.
-