Class EmbeddedDuplexChannel

  • All Implemented Interfaces:
    io.netty.channel.Channel, io.netty.channel.ChannelOutboundInvoker, io.netty.channel.socket.DuplexChannel, io.netty.util.AttributeMap, java.lang.Comparable<io.netty.channel.Channel>

    public final class EmbeddedDuplexChannel
    extends io.netty.channel.embedded.EmbeddedChannel
    implements io.netty.channel.socket.DuplexChannel
    EmbeddedChannel that implements DuplexChannel.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel

        io.netty.channel.AbstractChannel.AbstractUnsafe
      • Nested classes/interfaces inherited from interface io.netty.channel.Channel

        io.netty.channel.Channel.Unsafe
    • Constructor Summary

      Constructors 
      Constructor Description
      EmbeddedDuplexChannel​(boolean autoRead, io.netty.channel.ChannelHandler... handlers)
      Create a new instance with the pipeline initialized with the specified handlers.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void awaitInputShutdown()
      Awaits completion of shutdownInput().
      void awaitOutputShutdown()
      Awaits completion of shutdownOutput().
      io.netty.channel.ChannelConfig config()  
      protected void doClose()  
      protected void doRegister()  
      protected void doShutdownOutput()  
      io.netty.channel.embedded.EmbeddedChannel flushInbound()  
      io.netty.channel.embedded.EmbeddedChannel flushOutbound()  
      protected void handleInboundMessage​(java.lang.Object msg)  
      protected void handleOutboundMessage​(java.lang.Object msg)  
      java.util.Queue<java.lang.Object> inboundMessages()  
      boolean isActive()  
      boolean isInputShutdown()  
      boolean isOpen()  
      boolean isOutputShutdown()  
      boolean isShutdown()  
      protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()  
      java.util.Queue<java.lang.Object> outboundMessages()  
      io.netty.channel.ChannelFuture shutdown()  
      io.netty.channel.ChannelFuture shutdown​(io.netty.channel.ChannelPromise promise)  
      io.netty.channel.ChannelFuture shutdownInput()  
      io.netty.channel.ChannelFuture shutdownInput​(io.netty.channel.ChannelPromise promise)  
      io.netty.channel.ChannelFuture shutdownOutput()  
      io.netty.channel.ChannelFuture shutdownOutput​(io.netty.channel.ChannelPromise promise)  
      io.netty.channel.Channel.Unsafe unsafe()  
      boolean writeInbound​(java.lang.Object... msgs)  
      io.netty.channel.ChannelFuture writeOneInbound​(java.lang.Object msg, io.netty.channel.ChannelPromise promise)  
      io.netty.channel.ChannelFuture writeOneOutbound​(java.lang.Object msg, io.netty.channel.ChannelPromise promise)  
      boolean writeOutbound​(java.lang.Object... msgs)  
      • Methods inherited from class io.netty.channel.embedded.EmbeddedChannel

        checkException, close, close, disconnect, disconnect, doBeginRead, doBind, doDisconnect, doWrite, ensureOpen, finish, finishAndReleaseAll, isCompatible, lastInboundBuffer, lastOutboundBuffer, localAddress0, metadata, newChannelPipeline, readInbound, readOutbound, register, releaseInbound, releaseOutbound, remoteAddress0, runPendingTasks, runScheduledPendingTasks, writeOneInbound, writeOneOutbound
      • Methods inherited from class io.netty.channel.AbstractChannel

        alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, doDeregister, equals, eventLoop, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, remoteAddress, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
      • Methods inherited from class io.netty.util.DefaultAttributeMap

        attr, hasAttr
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.netty.util.AttributeMap

        attr, hasAttr
      • Methods inherited from interface io.netty.channel.Channel

        alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, localAddress, metadata, parent, pipeline, read, remoteAddress
      • Methods inherited from interface io.netty.channel.ChannelOutboundInvoker

        bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Constructor Detail

      • EmbeddedDuplexChannel

        public EmbeddedDuplexChannel​(boolean autoRead,
                                     io.netty.channel.ChannelHandler... handlers)
        Create a new instance with the pipeline initialized with the specified handlers.
        Parameters:
        autoRead - true if the auto-read should be enabled, otherwise false
        handlers - the ChannelHandlers which will be add in the ChannelPipeline
    • Method Detail

      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface io.netty.channel.Channel
        Overrides:
        isOpen in class io.netty.channel.embedded.EmbeddedChannel
      • isActive

        public boolean isActive()
        Specified by:
        isActive in interface io.netty.channel.Channel
        Overrides:
        isActive in class io.netty.channel.embedded.EmbeddedChannel
      • doRegister

        protected void doRegister()
                           throws java.lang.Exception
        Overrides:
        doRegister in class io.netty.channel.embedded.EmbeddedChannel
        Throws:
        java.lang.Exception
      • doClose

        protected void doClose()
                        throws java.lang.Exception
        Overrides:
        doClose in class io.netty.channel.embedded.EmbeddedChannel
        Throws:
        java.lang.Exception
      • isInputShutdown

        public boolean isInputShutdown()
        Specified by:
        isInputShutdown in interface io.netty.channel.socket.DuplexChannel
      • awaitInputShutdown

        public void awaitInputShutdown()
                                throws java.lang.InterruptedException
        Awaits completion of shutdownInput().
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • shutdownInput

        public io.netty.channel.ChannelFuture shutdownInput()
        Specified by:
        shutdownInput in interface io.netty.channel.socket.DuplexChannel
      • shutdownInput

        public io.netty.channel.ChannelFuture shutdownInput​(io.netty.channel.ChannelPromise promise)
        Specified by:
        shutdownInput in interface io.netty.channel.socket.DuplexChannel
      • isOutputShutdown

        public boolean isOutputShutdown()
        Specified by:
        isOutputShutdown in interface io.netty.channel.socket.DuplexChannel
      • awaitOutputShutdown

        public void awaitOutputShutdown()
                                 throws java.lang.InterruptedException
        Awaits completion of shutdownOutput().
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • shutdownOutput

        public io.netty.channel.ChannelFuture shutdownOutput()
        Specified by:
        shutdownOutput in interface io.netty.channel.socket.DuplexChannel
      • shutdownOutput

        public io.netty.channel.ChannelFuture shutdownOutput​(io.netty.channel.ChannelPromise promise)
        Specified by:
        shutdownOutput in interface io.netty.channel.socket.DuplexChannel
      • doShutdownOutput

        protected void doShutdownOutput()
                                 throws java.lang.Exception
        Overrides:
        doShutdownOutput in class io.netty.channel.AbstractChannel
        Throws:
        java.lang.Exception
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface io.netty.channel.socket.DuplexChannel
      • shutdown

        public io.netty.channel.ChannelFuture shutdown()
        Specified by:
        shutdown in interface io.netty.channel.socket.DuplexChannel
      • shutdown

        public io.netty.channel.ChannelFuture shutdown​(io.netty.channel.ChannelPromise promise)
        Specified by:
        shutdown in interface io.netty.channel.socket.DuplexChannel
      • inboundMessages

        public java.util.Queue<java.lang.Object> inboundMessages()
        Overrides:
        inboundMessages in class io.netty.channel.embedded.EmbeddedChannel
      • writeOneInbound

        public io.netty.channel.ChannelFuture writeOneInbound​(java.lang.Object msg,
                                                              io.netty.channel.ChannelPromise promise)
        Overrides:
        writeOneInbound in class io.netty.channel.embedded.EmbeddedChannel
      • writeInbound

        public boolean writeInbound​(java.lang.Object... msgs)
        Overrides:
        writeInbound in class io.netty.channel.embedded.EmbeddedChannel
      • flushInbound

        public io.netty.channel.embedded.EmbeddedChannel flushInbound()
        Overrides:
        flushInbound in class io.netty.channel.embedded.EmbeddedChannel
      • handleInboundMessage

        protected void handleInboundMessage​(java.lang.Object msg)
        Overrides:
        handleInboundMessage in class io.netty.channel.embedded.EmbeddedChannel
      • outboundMessages

        public java.util.Queue<java.lang.Object> outboundMessages()
        Overrides:
        outboundMessages in class io.netty.channel.embedded.EmbeddedChannel
      • writeOneOutbound

        public io.netty.channel.ChannelFuture writeOneOutbound​(java.lang.Object msg,
                                                               io.netty.channel.ChannelPromise promise)
        Overrides:
        writeOneOutbound in class io.netty.channel.embedded.EmbeddedChannel
      • writeOutbound

        public boolean writeOutbound​(java.lang.Object... msgs)
        Overrides:
        writeOutbound in class io.netty.channel.embedded.EmbeddedChannel
      • flushOutbound

        public io.netty.channel.embedded.EmbeddedChannel flushOutbound()
        Overrides:
        flushOutbound in class io.netty.channel.embedded.EmbeddedChannel
      • handleOutboundMessage

        protected void handleOutboundMessage​(java.lang.Object msg)
        Overrides:
        handleOutboundMessage in class io.netty.channel.embedded.EmbeddedChannel
      • config

        public io.netty.channel.ChannelConfig config()
        Specified by:
        config in interface io.netty.channel.Channel
        Overrides:
        config in class io.netty.channel.embedded.EmbeddedChannel
      • newUnsafe

        protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()
        Overrides:
        newUnsafe in class io.netty.channel.embedded.EmbeddedChannel
      • unsafe

        public io.netty.channel.Channel.Unsafe unsafe()
        Specified by:
        unsafe in interface io.netty.channel.Channel
        Overrides:
        unsafe in class io.netty.channel.embedded.EmbeddedChannel