Package io.undertow.protocols.http2
Class Http2DataStreamSinkChannel
java.lang.Object
io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
io.undertow.protocols.http2.AbstractHttp2StreamSinkChannel
io.undertow.protocols.http2.Http2StreamSinkChannel
io.undertow.protocols.http2.Http2DataStreamSinkChannel
- All Implemented Interfaces:
Http2Stream
,Closeable
,AutoCloseable
,Channel
,GatheringByteChannel
,InterruptibleChannel
,WritableByteChannel
,org.xnio.channels.CloseableChannel
,org.xnio.channels.Configurable
,org.xnio.channels.StreamSinkChannel
,org.xnio.channels.SuspendableWriteChannel
- Direct Known Subclasses:
Http2HeadersStreamSinkChannel
,Http2PushPromiseStreamSinkChannel
Headers channel
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called when a channel has been forcibly closed, and data (frames) have already been written.protected SendFrameHeader
boolean
flush()
org.xnio.ChannelListener<Http2DataStreamSinkChannel>
protected void
handleFlushComplete
(boolean finalFrame) protected boolean
void
setCompletionListener
(org.xnio.ChannelListener<Http2DataStreamSinkChannel> completionListener) void
setTrailersProducer
(Http2DataStreamSinkChannel.TrailersProducer trailersProducer) int
write
(ByteBuffer src) long
write
(ByteBuffer[] srcs) long
write
(ByteBuffer[] srcs, int offset, int length) protected void
writeBeforeHeaderBlock
(ByteBuffer buffer) int
writeFinal
(ByteBuffer src) long
writeFinal
(ByteBuffer[] srcs) long
writeFinal
(ByteBuffer[] srcs, int offset, int length) Methods inherited from class io.undertow.protocols.http2.Http2StreamSinkChannel
allocateAll, awaitWritable, awaitWritable, createFrameHeader, getStreamId, grabFlowControlBytes
Methods inherited from class io.undertow.protocols.http2.AbstractHttp2StreamSinkChannel
isLastFrame
Methods inherited from class io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel
close, getAwaitWritableTimeout, getBuffer, getChannel, getCloseSetter, getIoThread, getOption, getWorker, getWriteSetter, getWriteThread, isBroken, isBufferFull, isFinalFrameQueued, isFirstDataWritten, isOpen, isReadyForFlush, isWriteResumed, isWritesShutdown, markBroken, preWriteTransform, resumeWrites, resumeWritesInternal, safeToSend, send, sendInternal, setOption, shutdownWrites, supportsOption, suspendWrites, transferFrom, transferFrom, wakeupWrites
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.undertow.protocols.http2.Http2Stream
getStreamId
-
Method Details
-
getTrailersProducer
-
setTrailersProducer
-
createFrameHeaderImpl
- Specified by:
createFrameHeaderImpl
in classHttp2StreamSinkChannel
-
write
- Specified by:
write
in interfaceGatheringByteChannel
- Overrides:
write
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
write
- Specified by:
write
in interfaceGatheringByteChannel
- Overrides:
write
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
write
- Specified by:
write
in interfaceWritableByteChannel
- Overrides:
write
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
writeFinal
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Overrides:
writeFinal
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
writeFinal
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Overrides:
writeFinal
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
writeFinal
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Overrides:
writeFinal
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
flush
- Specified by:
flush
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Overrides:
flush
in classAbstractFramedStreamSinkChannel<Http2Channel,
AbstractHttp2StreamSourceChannel, AbstractHttp2StreamSinkChannel> - Throws:
IOException
-
writeBeforeHeaderBlock
-
isFlushRequiredOnEmptyBuffer
protected boolean isFlushRequiredOnEmptyBuffer() -
getHeaders
-
handleFlushComplete
protected void handleFlushComplete(boolean finalFrame) - Overrides:
handleFlushComplete
in classHttp2StreamSinkChannel
-
channelForciblyClosed
Description copied from class:AbstractFramedStreamSinkChannel
Called when a channel has been forcibly closed, and data (frames) have already been written. The action this should take is protocol dependent, e.g. for SPDY a RST_STREAM should be sent, for websockets the channel should be closed. By default this will just close the underlying channel- Overrides:
channelForciblyClosed
in classHttp2StreamSinkChannel
- Throws:
IOException
-
getCompletionListener
-
setCompletionListener
public void setCompletionListener(org.xnio.ChannelListener<Http2DataStreamSinkChannel> completionListener)
-