Class NettyEventLoopUtil


  • public class NettyEventLoopUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class<? extends io.netty.channel.Channel> clientChannelClass​(IOMode mode)
      Returns the correct (client) SocketChannel class based on IOMode.
      static io.netty.channel.EventLoopGroup createEventLoop​(IOMode mode, int numThreads, java.lang.String prefix)
      Create a Netty EventLoopGroup based on the IOMode.
      static void enableTriggeredMode​(IOMode ioMode, boolean enableLt, io.netty.bootstrap.ServerBootstrap serverBootstrap)
      Use EpollMode.LEVEL_TRIGGERED for server bootstrap if level trigger enabled by system properties, otherwise use EpollMode.EDGE_TRIGGERED.
      static java.lang.Class<? extends io.netty.channel.ServerChannel> serverChannelClass​(IOMode mode)
      Returns the correct ServerSocketChannel class based on IOMode.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NettyEventLoopUtil

        public NettyEventLoopUtil()
    • Method Detail

      • createEventLoop

        public static io.netty.channel.EventLoopGroup createEventLoop​(IOMode mode,
                                                                      int numThreads,
                                                                      java.lang.String prefix)
        Create a Netty EventLoopGroup based on the IOMode.
      • clientChannelClass

        public static java.lang.Class<? extends io.netty.channel.Channel> clientChannelClass​(IOMode mode)
        Returns the correct (client) SocketChannel class based on IOMode.
      • serverChannelClass

        public static java.lang.Class<? extends io.netty.channel.ServerChannel> serverChannelClass​(IOMode mode)
        Returns the correct ServerSocketChannel class based on IOMode.
      • enableTriggeredMode

        public static void enableTriggeredMode​(IOMode ioMode,
                                               boolean enableLt,
                                               io.netty.bootstrap.ServerBootstrap serverBootstrap)
        Use EpollMode.LEVEL_TRIGGERED for server bootstrap if level trigger enabled by system properties, otherwise use EpollMode.EDGE_TRIGGERED.