Class NettyNetworkServerInitializer

java.lang.Object
io.netty5.channel.ChannelInitializer<io.netty5.channel.Channel>
eu.cloudnetservice.driver.network.netty.NettyOptionSettingChannelInitializer
eu.cloudnetservice.driver.network.netty.server.NettyNetworkServerInitializer
All Implemented Interfaces:
io.netty5.channel.ChannelHandler

public class NettyNetworkServerInitializer extends NettyOptionSettingChannelInitializer
The default netty based handler responsible to initialize new channels which get connected to the current node.
Since:
4.0
  • Field Details

  • Constructor Details

    • NettyNetworkServerInitializer

      public NettyNetworkServerInitializer(@NonNull @NonNull EventManager eventManager, @NonNull @NonNull NettyNetworkServer networkServer, @NonNull @NonNull HostAndPort serverLocalAddress)
      Constructs a new network initializer instance.
      Parameters:
      eventManager - the event manager of the current component.
      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

      protected void doInitChannel(@NonNull @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. This channel removes the need for overriding classes to call super.initChannel in order to get all channel options activated.
      Overrides:
      doInitChannel in class NettyOptionSettingChannelInitializer
      Parameters:
      ch - the channel to initialize.