Class NettyConnectionFactoryTransport

    • Field Detail

      • logger

        protected final Logger logger
        Logger for this class.
      • channelType

        private final Class<? extends io.netty.channel.Channel> channelType
        Channel type.
      • ioWorkerGroup

        private final io.netty.channel.EventLoopGroup ioWorkerGroup
        Event loop group for I/O, must support the channel type.
      • messageWorkerGroup

        private final io.netty.channel.EventLoopGroup messageWorkerGroup
        Event loop group for message handling.
      • shutdownOnClose

        private boolean shutdownOnClose
        Whether to shut down the event loop groups on close().
    • Constructor Detail

      • NettyConnectionFactoryTransport

        public NettyConnectionFactoryTransport​(Class<? extends io.netty.channel.Channel> type,
                                               io.netty.channel.EventLoopGroup ioGroup)
        Creates a new netty connection factory transport.
        Parameters:
        type - of channel
        ioGroup - event loop group to handle I/O
      • NettyConnectionFactoryTransport

        public NettyConnectionFactoryTransport​(Class<? extends io.netty.channel.Channel> type,
                                               io.netty.channel.EventLoopGroup ioGroup,
                                               io.netty.channel.EventLoopGroup messageGroup)
        Creates a new netty connection factory transport.
        Parameters:
        type - of channel
        ioGroup - event loop group to handle I/O
        messageGroup - event loop group to handle inbound messages, can be null
    • Method Detail

      • setShutdownOnClose

        public void setShutdownOnClose​(boolean b)
        Sets whether to shut down the event loop groups on close.
        Parameters:
        b - whether to shut down on close
      • create

        public Connection create​(ConnectionConfig cc)
        Description copied from interface: Transport
        Create a connection object. Implementations should not open a TCP socket in this method.
        Specified by:
        create in interface Transport
        Parameters:
        cc - connection configuration
        Returns:
        connection
      • close

        public void close()
        Description copied from interface: Transport
        Free any resources associated with this transport.
        Specified by:
        close in interface Transport