Class NettyNetworkClientInitializer
java.lang.Object
io.netty5.channel.ChannelInitializer<io.netty5.channel.Channel>
eu.cloudnetservice.driver.network.netty.NettyOptionSettingChannelInitializer
eu.cloudnetservice.driver.network.netty.client.NettyNetworkClientInitializer
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
The channel handler implementation responsible for initializing the newly opened channel.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EventManagerprotected final HostAndPortprotected final NettyNetworkClient -
Constructor Summary
ConstructorsConstructorDescriptionNettyNetworkClientInitializer(@NonNull HostAndPort targetHost, @NonNull EventManager eventManager, @NonNull NettyNetworkClient networkClient) Constructs a new network client initializer instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoInitChannel(@NonNull io.netty5.channel.Channel channel) Method that gets called when the actual channel initialization finished and all requested channel options were activated in the channel.Methods inherited from class eu.cloudnetservice.driver.network.netty.NettyOptionSettingChannelInitializer
initChannel, optionMethods inherited from class io.netty5.channel.ChannelInitializer
channelExceptionCaught, handlerAdded, isSharableMethods inherited from class java.lang.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
-
hostAndPort
-
eventManager
-
nettyNetworkClient
-
-
Constructor Details
-
NettyNetworkClientInitializer
public NettyNetworkClientInitializer(@NonNull @NonNull HostAndPort targetHost, @NonNull @NonNull EventManager eventManager, @NonNull @NonNull NettyNetworkClient networkClient) Constructs a new network client initializer instance.- Parameters:
targetHost- the target host to which the network client connected.eventManager- the event manager of the current component.networkClient- the network client which connected to a server.- Throws:
NullPointerException- if either the event manager, target host or client 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:
channel- the channel to initialize.
-