Class EmbeddedChannel

    • Field Detail

      • LOCAL_ADDRESS

        private static final java.net.SocketAddress LOCAL_ADDRESS
      • REMOTE_ADDRESS

        private static final java.net.SocketAddress REMOTE_ADDRESS
      • EMPTY_HANDLERS

        private static final ChannelHandler[] EMPTY_HANDLERS
      • METADATA_NO_DISCONNECT

        private static final ChannelMetadata METADATA_NO_DISCONNECT
      • METADATA_DISCONNECT

        private static final ChannelMetadata METADATA_DISCONNECT
      • inboundMessages

        private java.util.Queue<java.lang.Object> inboundMessages
      • outboundMessages

        private java.util.Queue<java.lang.Object> outboundMessages
      • lastException

        private java.lang.Throwable lastException
    • Constructor Detail

      • EmbeddedChannel

        public EmbeddedChannel()
        Create a new instance with an EmbeddedChannelId and an empty pipeline.
      • EmbeddedChannel

        public EmbeddedChannel​(ChannelId channelId)
        Create a new instance with the specified ID and an empty pipeline.
        Parameters:
        channelId - the ChannelId that will be used to identify this channel
      • EmbeddedChannel

        public EmbeddedChannel​(ChannelHandler... handlers)
        Create a new instance with the pipeline initialized with the specified handlers.
        Parameters:
        handlers - the ChannelHandlers which will be add in the ChannelPipeline
      • EmbeddedChannel

        public EmbeddedChannel​(boolean hasDisconnect,
                               ChannelHandler... handlers)
        Create a new instance with the pipeline initialized with the specified handlers.
        Parameters:
        hasDisconnect - false if this Channel will delegate disconnect() to close(), true otherwise.
        handlers - the ChannelHandlers which will be added to the ChannelPipeline
      • EmbeddedChannel

        public EmbeddedChannel​(boolean register,
                               boolean hasDisconnect,
                               ChannelHandler... handlers)
        Create a new instance with the pipeline initialized with the specified handlers.
        Parameters:
        register - true if this Channel is registered to the EventLoop in the constructor. If false the user will need to call register().
        hasDisconnect - false if this Channel will delegate disconnect() to close(), true otherwise.
        handlers - the ChannelHandlers which will be added to the ChannelPipeline
      • EmbeddedChannel

        public EmbeddedChannel​(ChannelId channelId,
                               ChannelHandler... handlers)
        Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.
        Parameters:
        channelId - the ChannelId that will be used to identify this channel
        handlers - the ChannelHandlers which will be added to the ChannelPipeline
      • EmbeddedChannel

        public EmbeddedChannel​(ChannelId channelId,
                               boolean hasDisconnect,
                               ChannelHandler... handlers)
        Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.
        Parameters:
        channelId - the ChannelId that will be used to identify this channel
        hasDisconnect - false if this Channel will delegate disconnect() to close(), true otherwise.
        handlers - the ChannelHandlers which will be added to the ChannelPipeline
      • EmbeddedChannel

        public EmbeddedChannel​(ChannelId channelId,
                               boolean register,
                               boolean hasDisconnect,
                               ChannelHandler... handlers)
        Create a new instance with the channel ID set to the given ID and the pipeline initialized with the specified handlers.
        Parameters:
        channelId - the ChannelId that will be used to identify this channel
        register - true if this Channel is registered to the EventLoop in the constructor. If false the user will need to call register().
        hasDisconnect - false if this Channel will delegate disconnect() to close(), true otherwise.
        handlers - the ChannelHandlers which will be added to the ChannelPipeline