Class AbstractHttp2StreamChannel
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- io.netty.handler.codec.http2.AbstractHttp2StreamChannel
-
- All Implemented Interfaces:
Channel
,ChannelOutboundInvoker
,Http2StreamChannel
,AttributeMap
,java.lang.Comparable<Channel>
- Direct Known Subclasses:
Http2MultiplexCodec.Http2MultiplexCodecStreamChannel
,Http2MultiplexHandler.Http2MultiplexHandlerStreamChannel
abstract class AbstractHttp2StreamChannel extends DefaultAttributeMap implements Http2StreamChannel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AbstractHttp2StreamChannel.FlowControlledFrameSizeEstimator
Returns the flow-control size for DATA frames, and 9 for all other frames.private class
AbstractHttp2StreamChannel.Http2ChannelUnsafe
private static class
AbstractHttp2StreamChannel.Http2StreamChannelConfig
ChannelConfig
so that the high and low writebuffer watermarks can reflect the outbound flow control window, without having to create a newWriteBufferWaterMark
object whenever the flow control window changes.private static class
AbstractHttp2StreamChannel.ReadStatus
The current status of the read-processing for aAbstractHttp2StreamChannel
.-
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelId
channelId
private ChannelPromise
closePromise
private AbstractHttp2StreamChannel.Http2StreamChannelConfig
config
private java.lang.Runnable
fireChannelWritabilityChangedTask
private boolean
firstFrameWritten
true
after the first HEADERS frame has been writtenprivate int
flowControlledBytes
private java.util.Queue<java.lang.Object>
inboundBuffer
private static InternalLogger
logger
private static ChannelMetadata
METADATA
private static int
MIN_HTTP2_FRAME_SIZE
Number of bytes to consider non-payload messages.private boolean
outboundClosed
private ChannelPipeline
pipeline
private boolean
readCompletePending
private AbstractHttp2StreamChannel.ReadStatus
readStatus
This variable represents if a read is in progress for the current channel or was requested.private boolean
registered
private Http2FrameCodec.DefaultHttp2FrameStream
stream
private static java.util.concurrent.atomic.AtomicLongFieldUpdater<AbstractHttp2StreamChannel>
TOTAL_PENDING_SIZE_UPDATER
private long
totalPendingSize
private AbstractHttp2StreamChannel.Http2ChannelUnsafe
unsafe
private int
unwritable
private static java.util.concurrent.atomic.AtomicIntegerFieldUpdater<AbstractHttp2StreamChannel>
UNWRITABLE_UPDATER
private ChannelFutureListener
windowUpdateFrameWriteListener
(package private) static Http2FrameStreamVisitor
WRITABLE_VISITOR
-
Constructor Summary
Constructors Constructor Description AbstractHttp2StreamChannel(Http2FrameCodec.DefaultHttp2FrameStream stream, int id, ChannelHandler inboundHandler)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addChannelToReadCompletePendingQueue()
ByteBufAllocator
alloc()
Return the assignedByteBufAllocator
which will be used to allocateByteBuf
s.ChannelFuture
bind(java.net.SocketAddress localAddress)
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
bind(java.net.SocketAddress localAddress, ChannelPromise promise)
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.long
bytesBeforeUnwritable()
Get how many bytes can be written untilChannel.isWritable()
returnsfalse
.long
bytesBeforeWritable()
Get how many bytes must be drained from underlying buffers untilChannel.isWritable()
returnstrue
.ChannelFuture
close()
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
close(ChannelPromise promise)
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
closeFuture()
Returns theChannelFuture
which will be notified when this channel is closed.(package private) void
closeOutbound()
int
compareTo(Channel o)
ChannelConfig
config()
Returns the configuration of this channel.ChannelFuture
connect(java.net.SocketAddress remoteAddress)
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
connect(java.net.SocketAddress remoteAddress, ChannelPromise promise)
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.private void
decrementPendingOutboundBytes(long size, boolean invokeLater)
ChannelFuture
deregister()
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
deregister(ChannelPromise promise)
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
disconnect()
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
disconnect(ChannelPromise promise)
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.boolean
equals(java.lang.Object o)
EventLoop
eventLoop()
private void
fireChannelWritabilityChanged(boolean invokeLater)
(package private) void
fireChildRead(Http2Frame frame)
Receive a read message.(package private) void
fireChildReadComplete()
Channel
flush()
Request to flush all pending messages via this ChannelOutboundInvoker.protected void
flush0(ChannelHandlerContext ctx)
int
hashCode()
ChannelId
id()
Returns the globally unique identifier of thisChannel
.private void
incrementPendingOutboundBytes(long size, boolean invokeLater)
boolean
isActive()
Returntrue
if theChannel
is active and so connected.boolean
isOpen()
Returnstrue
if theChannel
is open and may get active laterprotected abstract boolean
isParentReadInProgress()
boolean
isRegistered()
boolean
isWritable()
Returnstrue
if and only if the I/O thread will perform the requested write operation immediately.java.net.SocketAddress
localAddress()
Returns the local address where this channel is bound to.private void
maybeAddChannelToReadCompletePendingQueue()
ChannelMetadata
metadata()
ChannelFuture
newFailedFuture(java.lang.Throwable cause)
Create a newChannelFuture
which is marked as failed already.ChannelProgressivePromise
newProgressivePromise()
Return an newChannelProgressivePromise
ChannelPromise
newPromise()
Return a newChannelPromise
.ChannelFuture
newSucceededFuture()
Create a newChannelFuture
which is marked as succeeded already.Channel
parent()
Returns the parent of this channel.protected abstract ChannelHandlerContext
parentContext()
ChannelPipeline
pipeline()
Return the assignedChannelPipeline
.Channel
read()
Request to Read data from theChannel
into the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was read, and triggers achannelReadComplete
event so the handler can decide to continue reading.java.net.SocketAddress
remoteAddress()
Returns the remote address where this channel is connected to.private void
setUnwritable(boolean invokeLater)
private void
setWritable(boolean invokeLater)
Http2FrameStream
stream()
Returns theHttp2FrameStream
that belongs to this channel.(package private) void
streamClosed()
java.lang.String
toString()
(package private) void
trySetWritable()
Channel.Unsafe
unsafe()
Returns an internal-use-only object that provides unsafe operations.ChannelPromise
voidPromise()
Return a special ChannelPromise which can be reused for different operations.private static void
windowUpdateFrameWriteComplete(ChannelFuture future, Channel streamChannel)
ChannelFuture
write(java.lang.Object msg)
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.ChannelFuture
write(java.lang.Object msg, ChannelPromise promise)
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.protected ChannelFuture
write0(ChannelHandlerContext ctx, java.lang.Object msg)
ChannelFuture
writeAndFlush(java.lang.Object msg)
Shortcut for callChannelOutboundInvoker.write(Object)
andChannelOutboundInvoker.flush()
.ChannelFuture
writeAndFlush(java.lang.Object msg, ChannelPromise promise)
Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)
andChannelOutboundInvoker.flush()
.-
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
-
-
-
-
Field Detail
-
WRITABLE_VISITOR
static final Http2FrameStreamVisitor WRITABLE_VISITOR
-
logger
private static final InternalLogger logger
-
METADATA
private static final ChannelMetadata METADATA
-
MIN_HTTP2_FRAME_SIZE
private static final int MIN_HTTP2_FRAME_SIZE
Number of bytes to consider non-payload messages. 9 is arbitrary, but also the minimum size of an HTTP/2 frame. Primarily is non-zero.- See Also:
- Constant Field Values
-
TOTAL_PENDING_SIZE_UPDATER
private static final java.util.concurrent.atomic.AtomicLongFieldUpdater<AbstractHttp2StreamChannel> TOTAL_PENDING_SIZE_UPDATER
-
UNWRITABLE_UPDATER
private static final java.util.concurrent.atomic.AtomicIntegerFieldUpdater<AbstractHttp2StreamChannel> UNWRITABLE_UPDATER
-
windowUpdateFrameWriteListener
private final ChannelFutureListener windowUpdateFrameWriteListener
-
config
private final AbstractHttp2StreamChannel.Http2StreamChannelConfig config
-
unsafe
private final AbstractHttp2StreamChannel.Http2ChannelUnsafe unsafe
-
channelId
private final ChannelId channelId
-
pipeline
private final ChannelPipeline pipeline
-
stream
private final Http2FrameCodec.DefaultHttp2FrameStream stream
-
closePromise
private final ChannelPromise closePromise
-
registered
private volatile boolean registered
-
totalPendingSize
private volatile long totalPendingSize
-
unwritable
private volatile int unwritable
-
fireChannelWritabilityChangedTask
private java.lang.Runnable fireChannelWritabilityChangedTask
-
outboundClosed
private boolean outboundClosed
-
flowControlledBytes
private int flowControlledBytes
-
readStatus
private AbstractHttp2StreamChannel.ReadStatus readStatus
This variable represents if a read is in progress for the current channel or was requested. Note that depending upon theRecvByteBufAllocator
behavior a read may extend beyond theAbstractHttp2StreamChannel.Http2ChannelUnsafe.beginRead()
method scope. TheAbstractHttp2StreamChannel.Http2ChannelUnsafe.beginRead()
loop may drain all pending data, and then if the parent channel is reading this channel may still accept frames.
-
inboundBuffer
private java.util.Queue<java.lang.Object> inboundBuffer
-
firstFrameWritten
private boolean firstFrameWritten
true
after the first HEADERS frame has been written
-
readCompletePending
private boolean readCompletePending
-
-
Constructor Detail
-
AbstractHttp2StreamChannel
AbstractHttp2StreamChannel(Http2FrameCodec.DefaultHttp2FrameStream stream, int id, ChannelHandler inboundHandler)
-
-
Method Detail
-
windowUpdateFrameWriteComplete
private static void windowUpdateFrameWriteComplete(ChannelFuture future, Channel streamChannel)
-
incrementPendingOutboundBytes
private void incrementPendingOutboundBytes(long size, boolean invokeLater)
-
decrementPendingOutboundBytes
private void decrementPendingOutboundBytes(long size, boolean invokeLater)
-
trySetWritable
final void trySetWritable()
-
setWritable
private void setWritable(boolean invokeLater)
-
setUnwritable
private void setUnwritable(boolean invokeLater)
-
fireChannelWritabilityChanged
private void fireChannelWritabilityChanged(boolean invokeLater)
-
stream
public Http2FrameStream stream()
Description copied from interface:Http2StreamChannel
Returns theHttp2FrameStream
that belongs to this channel.- Specified by:
stream
in interfaceHttp2StreamChannel
-
closeOutbound
void closeOutbound()
-
streamClosed
void streamClosed()
-
metadata
public ChannelMetadata metadata()
Description copied from interface:Channel
-
config
public ChannelConfig config()
Description copied from interface:Channel
Returns the configuration of this channel.
-
isOpen
public boolean isOpen()
Description copied from interface:Channel
Returnstrue
if theChannel
is open and may get active later
-
isActive
public boolean isActive()
Description copied from interface:Channel
Returntrue
if theChannel
is active and so connected.
-
isWritable
public boolean isWritable()
Description copied from interface:Channel
Returnstrue
if and only if the I/O thread will perform the requested write operation immediately. Any write requests made when this method returnsfalse
are queued until the I/O thread is ready to process the queued write requests.- Specified by:
isWritable
in interfaceChannel
-
id
public ChannelId id()
Description copied from interface:Channel
Returns the globally unique identifier of thisChannel
.
-
parent
public Channel parent()
Description copied from interface:Channel
Returns the parent of this channel.
-
isRegistered
public boolean isRegistered()
Description copied from interface:Channel
- Specified by:
isRegistered
in interfaceChannel
-
localAddress
public java.net.SocketAddress localAddress()
Description copied from interface:Channel
Returns the local address where this channel is bound to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
localAddress
in interfaceChannel
- Returns:
- the local address of this channel.
null
if this channel is not bound.
-
remoteAddress
public java.net.SocketAddress remoteAddress()
Description copied from interface:Channel
Returns the remote address where this channel is connected to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
remoteAddress
in interfaceChannel
- Returns:
- the remote address of this channel.
null
if this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g.DatagramChannel
, useDefaultAddressedEnvelope.recipient()
to determine the origination of the received message as this method will returnnull
.
-
closeFuture
public ChannelFuture closeFuture()
Description copied from interface:Channel
Returns theChannelFuture
which will be notified when this channel is closed. This method always returns the same future instance.- Specified by:
closeFuture
in interfaceChannel
-
bytesBeforeUnwritable
public long bytesBeforeUnwritable()
Description copied from interface:Channel
Get how many bytes can be written untilChannel.isWritable()
returnsfalse
. This quantity will always be non-negative. IfChannel.isWritable()
isfalse
then 0.- Specified by:
bytesBeforeUnwritable
in interfaceChannel
-
bytesBeforeWritable
public long bytesBeforeWritable()
Description copied from interface:Channel
Get how many bytes must be drained from underlying buffers untilChannel.isWritable()
returnstrue
. This quantity will always be non-negative. IfChannel.isWritable()
istrue
then 0.- Specified by:
bytesBeforeWritable
in interfaceChannel
-
unsafe
public Channel.Unsafe unsafe()
Description copied from interface:Channel
Returns an internal-use-only object that provides unsafe operations.
-
pipeline
public ChannelPipeline pipeline()
Description copied from interface:Channel
Return the assignedChannelPipeline
.
-
alloc
public ByteBufAllocator alloc()
Description copied from interface:Channel
Return the assignedByteBufAllocator
which will be used to allocateByteBuf
s.
-
read
public Channel read()
Description copied from interface:ChannelOutboundInvoker
Request to Read data from theChannel
into the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was read, and triggers achannelReadComplete
event so the handler can decide to continue reading. If there's a pending read operation already, this method does nothing.This will result in having the
ChannelOutboundHandler.read(ChannelHandlerContext)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
read
in interfaceChannel
- Specified by:
read
in interfaceChannelOutboundInvoker
-
flush
public Channel flush()
Description copied from interface:ChannelOutboundInvoker
Request to flush all pending messages via this ChannelOutboundInvoker.- Specified by:
flush
in interfaceChannel
- Specified by:
flush
in interfaceChannelOutboundInvoker
-
bind
public ChannelFuture bind(java.net.SocketAddress localAddress)
Description copied from interface:ChannelOutboundInvoker
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
bind
in interfaceChannelOutboundInvoker
-
connect
public ChannelFuture connect(java.net.SocketAddress remoteAddress)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuture
will get failed with aConnectTimeoutException
. If it fails because of connection refused aConnectException
will be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannelOutboundInvoker
-
connect
public ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannelOutboundInvoker
-
disconnect
public ChannelFuture disconnect()
Description copied from interface:ChannelOutboundInvoker
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
disconnect
in interfaceChannelOutboundInvoker
-
close
public ChannelFuture close()
Description copied from interface:ChannelOutboundInvoker
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
close
in interfaceChannelOutboundInvoker
-
deregister
public ChannelFuture deregister()
Description copied from interface:ChannelOutboundInvoker
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
deregister
in interfaceChannelOutboundInvoker
-
bind
public ChannelFuture bind(java.net.SocketAddress localAddress, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
bind
in interfaceChannelOutboundInvoker
-
connect
public ChannelFuture connect(java.net.SocketAddress remoteAddress, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelFuture
will be notified.If the connection fails because of a connection timeout, the
ChannelFuture
will get failed with aConnectTimeoutException
. If it fails because of connection refused aConnectException
will be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannelOutboundInvoker
-
connect
public ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
connect
in interfaceChannelOutboundInvoker
-
disconnect
public ChannelFuture disconnect(ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
disconnect
in interfaceChannelOutboundInvoker
-
close
public ChannelFuture close(ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
close
in interfaceChannelOutboundInvoker
-
deregister
public ChannelFuture deregister(ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.- Specified by:
deregister
in interfaceChannelOutboundInvoker
-
write
public ChannelFuture write(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvoker
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
. This method will not request to actual flush, so be sure to callChannelOutboundInvoker.flush()
once you want to request to flush all pending data to the actual transport.- Specified by:
write
in interfaceChannelOutboundInvoker
-
write
public ChannelFuture write(java.lang.Object msg, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
. This method will not request to actual flush, so be sure to callChannelOutboundInvoker.flush()
once you want to request to flush all pending data to the actual transport.- Specified by:
write
in interfaceChannelOutboundInvoker
-
writeAndFlush
public ChannelFuture writeAndFlush(java.lang.Object msg, ChannelPromise promise)
Description copied from interface:ChannelOutboundInvoker
Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)
andChannelOutboundInvoker.flush()
.- Specified by:
writeAndFlush
in interfaceChannelOutboundInvoker
-
writeAndFlush
public ChannelFuture writeAndFlush(java.lang.Object msg)
Description copied from interface:ChannelOutboundInvoker
Shortcut for callChannelOutboundInvoker.write(Object)
andChannelOutboundInvoker.flush()
.- Specified by:
writeAndFlush
in interfaceChannelOutboundInvoker
-
newPromise
public ChannelPromise newPromise()
Description copied from interface:ChannelOutboundInvoker
Return a newChannelPromise
.- Specified by:
newPromise
in interfaceChannelOutboundInvoker
-
newProgressivePromise
public ChannelProgressivePromise newProgressivePromise()
Description copied from interface:ChannelOutboundInvoker
Return an newChannelProgressivePromise
- Specified by:
newProgressivePromise
in interfaceChannelOutboundInvoker
-
newSucceededFuture
public ChannelFuture newSucceededFuture()
Description copied from interface:ChannelOutboundInvoker
Create a newChannelFuture
which is marked as succeeded already. SoFuture.isSuccess()
will returntrue
. AllFutureListener
added to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuture
in interfaceChannelOutboundInvoker
-
newFailedFuture
public ChannelFuture newFailedFuture(java.lang.Throwable cause)
Description copied from interface:ChannelOutboundInvoker
Create a newChannelFuture
which is marked as failed already. SoFuture.isSuccess()
will returnfalse
. AllFutureListener
added to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newFailedFuture
in interfaceChannelOutboundInvoker
-
voidPromise
public ChannelPromise voidPromise()
Description copied from interface:ChannelOutboundInvoker
Return a special ChannelPromise which can be reused for different operations.It's only supported to use it for
ChannelOutboundInvoker.write(Object, ChannelPromise)
.Be aware that the returned
Be aware this is an expert feature and should be used with care!ChannelPromise
will not support most operations and should only be used if you want to save an object allocation for every write operation. You will not be able to detect if the operation was complete, only if it failed as the implementation will callChannelPipeline.fireExceptionCaught(Throwable)
in this case.- Specified by:
voidPromise
in interfaceChannelOutboundInvoker
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(Channel o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Channel>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fireChildRead
void fireChildRead(Http2Frame frame)
Receive a read message. This does not notify handlers unless a read is in progress on the channel.
-
fireChildReadComplete
void fireChildReadComplete()
-
maybeAddChannelToReadCompletePendingQueue
private void maybeAddChannelToReadCompletePendingQueue()
-
flush0
protected void flush0(ChannelHandlerContext ctx)
-
write0
protected ChannelFuture write0(ChannelHandlerContext ctx, java.lang.Object msg)
-
isParentReadInProgress
protected abstract boolean isParentReadInProgress()
-
addChannelToReadCompletePendingQueue
protected abstract void addChannelToReadCompletePendingQueue()
-
parentContext
protected abstract ChannelHandlerContext parentContext()
-
-