Class ServerGroups


  • public class ServerGroups
    extends java.lang.Object
    A class that holds all opened ChannelGroup and EventLoopGroup.
    • Constructor Summary

      Constructors 
      Constructor Description
      ServerGroups​(ConfigManager configManager)
      Constructs a new ServerGroups instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.channel.EventLoopGroup getChildGroup()
      Returns the client event loop group.
      io.netty.channel.EventLoopGroup getServerGroup()
      Returns the server event loop group.
      void registerChannel​(io.netty.channel.Channel channel)
      Registers a channel to be tracked.
      void reset()
      Resets the ServerGroups.
      void shutdown​(boolean graceful)
      Shutdowns all opened channels and event loops.
      • Methods inherited from class java.lang.Object

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

      • ServerGroups

        public ServerGroups​(ConfigManager configManager)
        Constructs a new ServerGroups instance.
        Parameters:
        configManager - the configuration
    • Method Detail

      • reset

        public final void reset()
        Resets the ServerGroups.
      • shutdown

        public void shutdown​(boolean graceful)
        Shutdowns all opened channels and event loops.
        Parameters:
        graceful - ture for gracefully clean up the resources
      • getServerGroup

        public io.netty.channel.EventLoopGroup getServerGroup()
        Returns the server event loop group.
        Returns:
        the server event loop group
      • getChildGroup

        public io.netty.channel.EventLoopGroup getChildGroup()
        Returns the client event loop group.
        Returns:
        the client event loop group
      • registerChannel

        public void registerChannel​(io.netty.channel.Channel channel)
        Registers a channel to be tracked.
        Parameters:
        channel - a channel to be tracked