Class NettyConnection.ClientInitializer

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
    Enclosing class:
    NettyConnection

    private class NettyConnection.ClientInitializer
    extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
    Sets up the Netty pipeline for this connection. Handler configuration looks like: +-------------------------------------------------------------------+ | ChannelPipeline | | | | +-----------------------+ +-----------+----------+ | | | InboundMessageHandler | | RequestEncoder | | | +----------+------------+ +-----------+----------+ | | /|\ | | | | | | | +----------+------------+ | | | | MessageDecoder | | | | +----------+------------+ | | | /|\ | | | | | | | +----------+------------+ | | | | MessageFrameDecoder | | | | +----------+------------+ | | | /|\ | | | | \|/ | | +----------+------------+ +-----------+----------+ | | | I/O READ | | I/O WRITE | | | +----------+------------+ +-----------+----------+ | | /|\ \|/ | +---------------+-------------------------------------+-------------+
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private io.netty.handler.ssl.SslHandler sslHandler
      SSL handler.
    • Constructor Summary

      Constructors 
      Constructor Description
      ClientInitializer​(io.netty.handler.ssl.SslHandler handler)
      Creates a new client initializer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initChannel​(io.netty.channel.socket.SocketChannel ch)  
      boolean isSsl()
      Returns whether the SSL pipeline is in use.
      • Methods inherited from class io.netty.channel.ChannelInitializer

        channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, isSharable
    • Field Detail

      • sslHandler

        private final io.netty.handler.ssl.SslHandler sslHandler
        SSL handler.
    • Constructor Detail

      • ClientInitializer

        ClientInitializer​(io.netty.handler.ssl.SslHandler handler)
        Creates a new client initializer.
        Parameters:
        handler - SSL handler or null
    • Method Detail

      • initChannel

        public void initChannel​(io.netty.channel.socket.SocketChannel ch)
        Specified by:
        initChannel in class io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
      • isSsl

        public boolean isSsl()
        Returns whether the SSL pipeline is in use.
        Returns:
        whether the SSL pipeline is in use