public final class EmbeddedDuplexChannel
extends io.netty.channel.embedded.EmbeddedChannel
implements io.netty.channel.socket.DuplexChannel
EmbeddedChannel
that implements DuplexChannel
.Constructor and Description |
---|
EmbeddedDuplexChannel(boolean autoRead,
io.netty.channel.ChannelHandler... handlers)
Create a new instance with the pipeline initialized with the specified handlers.
|
Modifier and Type | Method and 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) |
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
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, localAddress, metadata, parent, pipeline, read, remoteAddress
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
public EmbeddedDuplexChannel(boolean autoRead, io.netty.channel.ChannelHandler... handlers)
autoRead
- true
if the auto-read should be enabled, otherwise false
handlers
- the ChannelHandler
s which will be add in the ChannelPipeline
public boolean isOpen()
isOpen
in interface io.netty.channel.Channel
isOpen
in class io.netty.channel.embedded.EmbeddedChannel
public boolean isActive()
isActive
in interface io.netty.channel.Channel
isActive
in class io.netty.channel.embedded.EmbeddedChannel
protected void doRegister() throws java.lang.Exception
doRegister
in class io.netty.channel.embedded.EmbeddedChannel
java.lang.Exception
protected void doClose() throws java.lang.Exception
doClose
in class io.netty.channel.embedded.EmbeddedChannel
java.lang.Exception
public boolean isInputShutdown()
isInputShutdown
in interface io.netty.channel.socket.DuplexChannel
public void awaitInputShutdown() throws java.lang.InterruptedException
shutdownInput()
.java.lang.InterruptedException
- if the current thread was interruptedpublic io.netty.channel.ChannelFuture shutdownInput()
shutdownInput
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdownInput(io.netty.channel.ChannelPromise promise)
shutdownInput
in interface io.netty.channel.socket.DuplexChannel
public boolean isOutputShutdown()
isOutputShutdown
in interface io.netty.channel.socket.DuplexChannel
public void awaitOutputShutdown() throws java.lang.InterruptedException
shutdownOutput()
.java.lang.InterruptedException
- if the current thread was interruptedpublic io.netty.channel.ChannelFuture shutdownOutput()
shutdownOutput
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdownOutput(io.netty.channel.ChannelPromise promise)
shutdownOutput
in interface io.netty.channel.socket.DuplexChannel
protected void doShutdownOutput() throws java.lang.Exception
doShutdownOutput
in class io.netty.channel.AbstractChannel
java.lang.Exception
public boolean isShutdown()
isShutdown
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdown()
shutdown
in interface io.netty.channel.socket.DuplexChannel
public io.netty.channel.ChannelFuture shutdown(io.netty.channel.ChannelPromise promise)
shutdown
in interface io.netty.channel.socket.DuplexChannel
public java.util.Queue<java.lang.Object> inboundMessages()
inboundMessages
in class io.netty.channel.embedded.EmbeddedChannel
public io.netty.channel.ChannelFuture writeOneInbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)
writeOneInbound
in class io.netty.channel.embedded.EmbeddedChannel
public boolean writeInbound(java.lang.Object... msgs)
writeInbound
in class io.netty.channel.embedded.EmbeddedChannel
public io.netty.channel.embedded.EmbeddedChannel flushInbound()
flushInbound
in class io.netty.channel.embedded.EmbeddedChannel
protected void handleInboundMessage(java.lang.Object msg)
handleInboundMessage
in class io.netty.channel.embedded.EmbeddedChannel
public java.util.Queue<java.lang.Object> outboundMessages()
outboundMessages
in class io.netty.channel.embedded.EmbeddedChannel
public io.netty.channel.ChannelFuture writeOneOutbound(java.lang.Object msg, io.netty.channel.ChannelPromise promise)
writeOneOutbound
in class io.netty.channel.embedded.EmbeddedChannel
public boolean writeOutbound(java.lang.Object... msgs)
writeOutbound
in class io.netty.channel.embedded.EmbeddedChannel
public io.netty.channel.embedded.EmbeddedChannel flushOutbound()
flushOutbound
in class io.netty.channel.embedded.EmbeddedChannel
protected void handleOutboundMessage(java.lang.Object msg)
handleOutboundMessage
in class io.netty.channel.embedded.EmbeddedChannel
public io.netty.channel.ChannelConfig config()
config
in interface io.netty.channel.Channel
config
in class io.netty.channel.embedded.EmbeddedChannel
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()
newUnsafe
in class io.netty.channel.embedded.EmbeddedChannel
public io.netty.channel.Channel.Unsafe unsafe()
unsafe
in interface io.netty.channel.Channel
unsafe
in class io.netty.channel.embedded.EmbeddedChannel