Class DefaultEventLoopGroupFactory

  • All Implemented Interfaces:
    EventLoopGroupFactory

    @Primary
    @Singleton
    public class DefaultEventLoopGroupFactory
    extends java.lang.Object
    implements EventLoopGroupFactory
    The default factory for EventLoopGroup instances.
    Since:
    1.0
    • Constructor Detail

      • DefaultEventLoopGroupFactory

        public DefaultEventLoopGroupFactory​(NioEventLoopGroupFactory nioEventLoopGroupFactory,
                                            @Nullable @Named("native")
                                            EventLoopGroupFactory nativeFactory)
        Default constructor.
        Parameters:
        nioEventLoopGroupFactory - The NIO factory
        nativeFactory - The native factory if available
      • DefaultEventLoopGroupFactory

        @Inject
        public DefaultEventLoopGroupFactory​(NioEventLoopGroupFactory nioEventLoopGroupFactory,
                                            @Nullable @Named("native")
                                            EventLoopGroupFactory nativeFactory,
                                            @Nullable
                                            NettyGlobalConfiguration nettyGlobalConfiguration)
        Default constructor.
        Parameters:
        nioEventLoopGroupFactory - The NIO factory
        nativeFactory - The native factory if available
        nettyGlobalConfiguration - The netty global configuration
    • Method Detail

      • createEventLoopGroup

        public io.netty.channel.EventLoopGroup createEventLoopGroup​(EventLoopGroupConfiguration configuration,
                                                                    java.util.concurrent.ThreadFactory threadFactory)
        Description copied from interface: EventLoopGroupFactory
        Create an event loop group for the given configuration and thread factory.
        Specified by:
        createEventLoopGroup in interface EventLoopGroupFactory
        Parameters:
        configuration - The configuration
        threadFactory - The thread factory
        Returns:
        The event loop group
      • createEventLoopGroup

        public io.netty.channel.EventLoopGroup createEventLoopGroup​(int threads,
                                                                    java.util.concurrent.Executor executor,
                                                                    @Nullable
                                                                    java.lang.Integer ioRatio)
        Description copied from interface: EventLoopGroupFactory
        Creates an EventLoopGroup.
        Specified by:
        createEventLoopGroup in interface EventLoopGroupFactory
        Parameters:
        threads - The number of threads to use.
        executor - An Executor.
        ioRatio - The io ratio.
        Returns:
        An EventLoopGroup.
      • createEventLoopGroup

        public io.netty.channel.EventLoopGroup createEventLoopGroup​(int threads,
                                                                    @Nullable
                                                                    java.util.concurrent.ThreadFactory threadFactory,
                                                                    @Nullable
                                                                    java.lang.Integer ioRatio)
        Description copied from interface: EventLoopGroupFactory
        Creates an EventLoopGroup.
        Specified by:
        createEventLoopGroup in interface EventLoopGroupFactory
        Parameters:
        threads - The number of threads to use.
        threadFactory - The thread factory.
        ioRatio - The io ratio.
        Returns:
        An EventLoopGroup.
      • serverSocketChannelClass

        public java.lang.Class<? extends io.netty.channel.socket.ServerSocketChannel> serverSocketChannelClass()
        Description copied from interface: EventLoopGroupFactory
        Returns the server channel class.
        Specified by:
        serverSocketChannelClass in interface EventLoopGroupFactory
        Returns:
        A ServerChannelClass.
      • domainServerSocketChannelClass

        public java.lang.Class<? extends io.netty.channel.unix.ServerDomainSocketChannel> domainServerSocketChannelClass()
                                                                                                                  throws java.lang.UnsupportedOperationException
        Description copied from interface: EventLoopGroupFactory
        Returns the domain socket server channel class.
        Specified by:
        domainServerSocketChannelClass in interface EventLoopGroupFactory
        Returns:
        A ServerDomainSocketChannel class.
        Throws:
        java.lang.UnsupportedOperationException - if domain sockets are not supported.