JavaScript is disabled on your browser.
Skip navigation links
io.netty.channel.embedded

Class EmbeddedChannel

    • Constructor Detail

      • EmbeddedChannel

        public EmbeddedChannel(ChannelHandler... handlers)
        Create a new instance
        Parameters:
        handlers - the @link ChannelHandler}s which will be add in the ChannelPipeline
      • EmbeddedChannel

        public EmbeddedChannel(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:
        hasDisconnect - false if this Channel will delegate disconnect() to close(), false otherwise.
        handlers - the ChannelHandlers which will be add in 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(), false otherwise.
        handlers - the ChannelHandlers which will be add in the ChannelPipeline
    • Method Detail

      • register

        public void register()
         throws java.lang.Exception
        Register this Channel on its EventLoop.
        Throws:
        java.lang.Exception
      • config

        public ChannelConfig config()
        Description copied from interface: Channel
        Returns the configuration of this channel.
      • isOpen

        public boolean isOpen()
        Description copied from interface: Channel
        Returns true if the Channel is open and may get active later
      • isActive

        public boolean isActive()
        Description copied from interface: Channel
        Return true if the Channel is active and so connected.
      • inboundMessages

        public java.util.Queue<java.lang.Object> inboundMessages()
        Returns the Queue which holds all the Objects that were received by this Channel.
      • lastInboundBuffer

        @Deprecated
        public java.util.Queue<java.lang.Object> lastInboundBuffer()
        Deprecated. use inboundMessages()
      • outboundMessages

        public java.util.Queue<java.lang.Object> outboundMessages()
        Returns the Queue which holds all the Objects that were written by this Channel.
      • lastOutboundBuffer

        @Deprecated
        public java.util.Queue<java.lang.Object> lastOutboundBuffer()
        Deprecated. use outboundMessages()
      • readInbound

        public java.lang.Object readInbound()
        Return received data from this Channel
      • readOutbound

        public java.lang.Object readOutbound()
        Read data from the outbound. This may return null if nothing is readable.
      • writeInbound

        public boolean writeInbound(java.lang.Object... msgs)
        Write messages to the inbound of this Channel.
        Parameters:
        msgs - the messages to be written
        Returns:
        true if the write operation did add something to the inbound buffer
      • writeOutbound

        public boolean writeOutbound(java.lang.Object... msgs)
        Write messages to the outbound of this Channel.
        Parameters:
        msgs - the messages to be written
        Returns:
        bufferReadable returns true if the write operation did add something to the outbound buffer
      • finish

        public boolean finish()
        Mark this Channel as finished. Any futher try to write data to it will fail.
        Returns:
        bufferReadable returns true if any of the used buffers has something left to read
      • finishAndReleaseAll

        public boolean finishAndReleaseAll()
        Mark this Channel as finished and release all pending message in the inbound and outbound buffer. Any further try to write data to it will fail.
        Returns:
        bufferReadable returns true if any of the used buffers has something left to read
      • releaseInbound

        public boolean releaseInbound()
        Release all buffered inbound messages and return true if any were in the inbound buffer, false otherwise.
      • releaseOutbound

        public boolean releaseOutbound()
        Release all buffered outbound messages and return true if any were in the outbound buffer, false otherwise.
      • runPendingTasks

        public void runPendingTasks()
        Run all tasks (which also includes scheduled tasks) that are pending in the EventLoop for this Channel
      • runScheduledPendingTasks

        public long runScheduledPendingTasks()
        Run all pending scheduled tasks in the EventLoop for this Channel and return the nanoseconds when the next scheduled task is ready to run. If no other task was scheduled it will return -1.
      • checkException

        public void checkException()
        Check if there was any Throwable received and if so rethrow it.
      • ensureOpen

        protected final void ensureOpen()
        Ensure the Channel is open and if not throw an exception.
      • doRegister

        protected void doRegister()
         throws java.lang.Exception
        Description copied from class: AbstractChannel
        Is called after the Channel is registered with its EventLoop as part of the register process. Sub-classes may override this method
        Overrides:
        doRegister in class AbstractChannel
        Throws:
        java.lang.Exception
      • doBind

        protected void doBind(java.net.SocketAddress localAddress)
         throws java.lang.Exception
        Description copied from class: AbstractChannel
        Bind the Channel to the SocketAddress
        Specified by:
        doBind in class AbstractChannel
        Throws:
        java.lang.Exception
      • doBeginRead

        protected void doBeginRead()
         throws java.lang.Exception
        Description copied from class: AbstractChannel
        Schedule a read operation.
        Specified by:
        doBeginRead in class AbstractChannel
        Throws:
        java.lang.Exception
Skip navigation links

Copyright © 2008–2018 The Netty Project. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /