Class EmbeddedDuplexChannel
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- io.netty.channel.AbstractChannel
-
- io.netty.channel.embedded.EmbeddedChannel
-
- io.servicetalk.transport.netty.internal.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 implementsDuplexChannel
.
-
-
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 ofshutdownInput()
.void
awaitOutputShutdown()
Awaits completion ofshutdownOutput()
.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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
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, otherwisefalse
handlers
- theChannelHandler
s which will be add in theChannelPipeline
-
-
Method Detail
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfaceio.netty.channel.Channel
- Overrides:
isOpen
in classio.netty.channel.embedded.EmbeddedChannel
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceio.netty.channel.Channel
- Overrides:
isActive
in classio.netty.channel.embedded.EmbeddedChannel
-
doRegister
protected void doRegister() throws java.lang.Exception
- Overrides:
doRegister
in classio.netty.channel.embedded.EmbeddedChannel
- Throws:
java.lang.Exception
-
doClose
protected void doClose() throws java.lang.Exception
- Overrides:
doClose
in classio.netty.channel.embedded.EmbeddedChannel
- Throws:
java.lang.Exception
-
isInputShutdown
public boolean isInputShutdown()
- Specified by:
isInputShutdown
in interfaceio.netty.channel.socket.DuplexChannel
-
awaitInputShutdown
public void awaitInputShutdown() throws java.lang.InterruptedException
Awaits completion ofshutdownInput()
.- Throws:
java.lang.InterruptedException
- if the current thread was interrupted
-
shutdownInput
public io.netty.channel.ChannelFuture shutdownInput()
- Specified by:
shutdownInput
in interfaceio.netty.channel.socket.DuplexChannel
-
shutdownInput
public io.netty.channel.ChannelFuture shutdownInput(io.netty.channel.ChannelPromise promise)
- Specified by:
shutdownInput
in interfaceio.netty.channel.socket.DuplexChannel
-
isOutputShutdown
public boolean isOutputShutdown()
- Specified by:
isOutputShutdown
in interfaceio.netty.channel.socket.DuplexChannel
-
awaitOutputShutdown
public void awaitOutputShutdown() throws java.lang.InterruptedException
Awaits completion ofshutdownOutput()
.- Throws:
java.lang.InterruptedException
- if the current thread was interrupted
-
shutdownOutput
public io.netty.channel.ChannelFuture shutdownOutput()
- Specified by:
shutdownOutput
in interfaceio.netty.channel.socket.DuplexChannel
-
shutdownOutput
public io.netty.channel.ChannelFuture shutdownOutput(io.netty.channel.ChannelPromise promise)
- Specified by:
shutdownOutput
in interfaceio.netty.channel.socket.DuplexChannel
-
doShutdownOutput
protected void doShutdownOutput() throws java.lang.Exception
- Overrides:
doShutdownOutput
in classio.netty.channel.AbstractChannel
- Throws:
java.lang.Exception
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfaceio.netty.channel.socket.DuplexChannel
-
shutdown
public io.netty.channel.ChannelFuture shutdown()
- Specified by:
shutdown
in interfaceio.netty.channel.socket.DuplexChannel
-
shutdown
public io.netty.channel.ChannelFuture shutdown(io.netty.channel.ChannelPromise promise)
- Specified by:
shutdown
in interfaceio.netty.channel.socket.DuplexChannel
-
inboundMessages
public java.util.Queue<java.lang.Object> inboundMessages()
- Overrides:
inboundMessages
in classio.netty.channel.embedded.EmbeddedChannel
-
writeOneInbound
public io.netty.channel.ChannelFuture writeOneInbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)
- Overrides:
writeOneInbound
in classio.netty.channel.embedded.EmbeddedChannel
-
writeInbound
public boolean writeInbound(java.lang.Object... msgs)
- Overrides:
writeInbound
in classio.netty.channel.embedded.EmbeddedChannel
-
flushInbound
public io.netty.channel.embedded.EmbeddedChannel flushInbound()
- Overrides:
flushInbound
in classio.netty.channel.embedded.EmbeddedChannel
-
handleInboundMessage
protected void handleInboundMessage(java.lang.Object msg)
- Overrides:
handleInboundMessage
in classio.netty.channel.embedded.EmbeddedChannel
-
outboundMessages
public java.util.Queue<java.lang.Object> outboundMessages()
- Overrides:
outboundMessages
in classio.netty.channel.embedded.EmbeddedChannel
-
writeOneOutbound
public io.netty.channel.ChannelFuture writeOneOutbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)
- Overrides:
writeOneOutbound
in classio.netty.channel.embedded.EmbeddedChannel
-
writeOutbound
public boolean writeOutbound(java.lang.Object... msgs)
- Overrides:
writeOutbound
in classio.netty.channel.embedded.EmbeddedChannel
-
flushOutbound
public io.netty.channel.embedded.EmbeddedChannel flushOutbound()
- Overrides:
flushOutbound
in classio.netty.channel.embedded.EmbeddedChannel
-
handleOutboundMessage
protected void handleOutboundMessage(java.lang.Object msg)
- Overrides:
handleOutboundMessage
in classio.netty.channel.embedded.EmbeddedChannel
-
config
public io.netty.channel.ChannelConfig config()
- Specified by:
config
in interfaceio.netty.channel.Channel
- Overrides:
config
in classio.netty.channel.embedded.EmbeddedChannel
-
newUnsafe
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()
- Overrides:
newUnsafe
in classio.netty.channel.embedded.EmbeddedChannel
-
unsafe
public io.netty.channel.Channel.Unsafe unsafe()
- Specified by:
unsafe
in interfaceio.netty.channel.Channel
- Overrides:
unsafe
in classio.netty.channel.embedded.EmbeddedChannel
-
-