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.DuplexChannelEmbeddedChannelthat 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 voidawaitInputShutdown()Awaits completion ofshutdownInput().voidawaitOutputShutdown()Awaits completion ofshutdownOutput().io.netty.channel.ChannelConfigconfig()protected voiddoClose()protected voiddoRegister()protected voiddoShutdownOutput()io.netty.channel.embedded.EmbeddedChannelflushInbound()io.netty.channel.embedded.EmbeddedChannelflushOutbound()protected voidhandleInboundMessage(java.lang.Object msg)protected voidhandleOutboundMessage(java.lang.Object msg)java.util.Queue<java.lang.Object>inboundMessages()booleanisActive()booleanisInputShutdown()booleanisOpen()booleanisOutputShutdown()booleanisShutdown()protected io.netty.channel.AbstractChannel.AbstractUnsafenewUnsafe()java.util.Queue<java.lang.Object>outboundMessages()io.netty.channel.ChannelFutureshutdown()io.netty.channel.ChannelFutureshutdown(io.netty.channel.ChannelPromise promise)io.netty.channel.ChannelFutureshutdownInput()io.netty.channel.ChannelFutureshutdownInput(io.netty.channel.ChannelPromise promise)io.netty.channel.ChannelFutureshutdownOutput()io.netty.channel.ChannelFutureshutdownOutput(io.netty.channel.ChannelPromise promise)io.netty.channel.Channel.Unsafeunsafe()booleanwriteInbound(java.lang.Object... msgs)io.netty.channel.ChannelFuturewriteOneInbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)io.netty.channel.ChannelFuturewriteOneOutbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)booleanwriteOutbound(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, maxMessagesPerWrite, 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-trueif the auto-read should be enabled, otherwisefalsehandlers- theChannelHandlers which will be add in theChannelPipeline
-
-
Method Detail
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceio.netty.channel.Channel- Overrides:
isOpenin classio.netty.channel.embedded.EmbeddedChannel
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceio.netty.channel.Channel- Overrides:
isActivein classio.netty.channel.embedded.EmbeddedChannel
-
doRegister
protected void doRegister() throws java.lang.Exception- Overrides:
doRegisterin classio.netty.channel.embedded.EmbeddedChannel- Throws:
java.lang.Exception
-
doClose
protected void doClose() throws java.lang.Exception- Overrides:
doClosein classio.netty.channel.embedded.EmbeddedChannel- Throws:
java.lang.Exception
-
isInputShutdown
public boolean isInputShutdown()
- Specified by:
isInputShutdownin interfaceio.netty.channel.socket.DuplexChannel
-
awaitInputShutdown
public void awaitInputShutdown() throws java.lang.InterruptedExceptionAwaits completion ofshutdownInput().- Throws:
java.lang.InterruptedException- if the current thread was interrupted
-
shutdownInput
public io.netty.channel.ChannelFuture shutdownInput()
- Specified by:
shutdownInputin interfaceio.netty.channel.socket.DuplexChannel
-
shutdownInput
public io.netty.channel.ChannelFuture shutdownInput(io.netty.channel.ChannelPromise promise)
- Specified by:
shutdownInputin interfaceio.netty.channel.socket.DuplexChannel
-
isOutputShutdown
public boolean isOutputShutdown()
- Specified by:
isOutputShutdownin interfaceio.netty.channel.socket.DuplexChannel
-
awaitOutputShutdown
public void awaitOutputShutdown() throws java.lang.InterruptedExceptionAwaits completion ofshutdownOutput().- Throws:
java.lang.InterruptedException- if the current thread was interrupted
-
shutdownOutput
public io.netty.channel.ChannelFuture shutdownOutput()
- Specified by:
shutdownOutputin interfaceio.netty.channel.socket.DuplexChannel
-
shutdownOutput
public io.netty.channel.ChannelFuture shutdownOutput(io.netty.channel.ChannelPromise promise)
- Specified by:
shutdownOutputin interfaceio.netty.channel.socket.DuplexChannel
-
doShutdownOutput
protected void doShutdownOutput() throws java.lang.Exception- Overrides:
doShutdownOutputin classio.netty.channel.AbstractChannel- Throws:
java.lang.Exception
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfaceio.netty.channel.socket.DuplexChannel
-
shutdown
public io.netty.channel.ChannelFuture shutdown()
- Specified by:
shutdownin interfaceio.netty.channel.socket.DuplexChannel
-
shutdown
public io.netty.channel.ChannelFuture shutdown(io.netty.channel.ChannelPromise promise)
- Specified by:
shutdownin interfaceio.netty.channel.socket.DuplexChannel
-
inboundMessages
public java.util.Queue<java.lang.Object> inboundMessages()
- Overrides:
inboundMessagesin classio.netty.channel.embedded.EmbeddedChannel
-
writeOneInbound
public io.netty.channel.ChannelFuture writeOneInbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)- Overrides:
writeOneInboundin classio.netty.channel.embedded.EmbeddedChannel
-
writeInbound
public boolean writeInbound(java.lang.Object... msgs)
- Overrides:
writeInboundin classio.netty.channel.embedded.EmbeddedChannel
-
flushInbound
public io.netty.channel.embedded.EmbeddedChannel flushInbound()
- Overrides:
flushInboundin classio.netty.channel.embedded.EmbeddedChannel
-
handleInboundMessage
protected void handleInboundMessage(java.lang.Object msg)
- Overrides:
handleInboundMessagein classio.netty.channel.embedded.EmbeddedChannel
-
outboundMessages
public java.util.Queue<java.lang.Object> outboundMessages()
- Overrides:
outboundMessagesin classio.netty.channel.embedded.EmbeddedChannel
-
writeOneOutbound
public io.netty.channel.ChannelFuture writeOneOutbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)- Overrides:
writeOneOutboundin classio.netty.channel.embedded.EmbeddedChannel
-
writeOutbound
public boolean writeOutbound(java.lang.Object... msgs)
- Overrides:
writeOutboundin classio.netty.channel.embedded.EmbeddedChannel
-
flushOutbound
public io.netty.channel.embedded.EmbeddedChannel flushOutbound()
- Overrides:
flushOutboundin classio.netty.channel.embedded.EmbeddedChannel
-
handleOutboundMessage
protected void handleOutboundMessage(java.lang.Object msg)
- Overrides:
handleOutboundMessagein classio.netty.channel.embedded.EmbeddedChannel
-
config
public io.netty.channel.ChannelConfig config()
- Specified by:
configin interfaceio.netty.channel.Channel- Overrides:
configin classio.netty.channel.embedded.EmbeddedChannel
-
newUnsafe
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()
- Overrides:
newUnsafein classio.netty.channel.embedded.EmbeddedChannel
-
unsafe
public io.netty.channel.Channel.Unsafe unsafe()
- Specified by:
unsafein interfaceio.netty.channel.Channel- Overrides:
unsafein classio.netty.channel.embedded.EmbeddedChannel
-
-