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
public class Http2DataStreamSinkChannel extends Http2StreamSinkChannel implements Http2Stream
Headers channel- Author:
- Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Http2DataStreamSinkChannel.TrailersProducer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
channelForciblyClosed()
Called when a channel has been forcibly closed, and data (frames) have already been written.protected SendFrameHeader
createFrameHeaderImpl()
boolean
flush()
org.xnio.ChannelListener<Http2DataStreamSinkChannel>
getCompletionListener()
HeaderMap
getHeaders()
Http2DataStreamSinkChannel.TrailersProducer
getTrailersProducer()
protected void
handleFlushComplete(boolean finalFrame)
protected boolean
isFlushRequiredOnEmptyBuffer()
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 Detail
-
getTrailersProducer
public Http2DataStreamSinkChannel.TrailersProducer getTrailersProducer()
-
setTrailersProducer
public void setTrailersProducer(Http2DataStreamSinkChannel.TrailersProducer trailersProducer)
-
createFrameHeaderImpl
protected SendFrameHeader createFrameHeaderImpl()
- Specified by:
createFrameHeaderImpl
in classHttp2StreamSinkChannel
-
write
public long write(ByteBuffer[] srcs, int offset, int length) throws IOException
- Specified by:
write
in interfaceGatheringByteChannel
- Overrides:
write
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
write
public long write(ByteBuffer[] srcs) throws IOException
- Specified by:
write
in interfaceGatheringByteChannel
- Overrides:
write
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
write
in interfaceWritableByteChannel
- Overrides:
write
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
writeFinal
public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Overrides:
writeFinal
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
writeFinal
public long writeFinal(ByteBuffer[] srcs) throws IOException
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Overrides:
writeFinal
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
writeFinal
public int writeFinal(ByteBuffer src) throws IOException
- Specified by:
writeFinal
in interfaceorg.xnio.channels.StreamSinkChannel
- Overrides:
writeFinal
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
flush
public boolean flush() throws IOException
- Specified by:
flush
in interfaceorg.xnio.channels.SuspendableWriteChannel
- Overrides:
flush
in classAbstractFramedStreamSinkChannel<Http2Channel,AbstractHttp2StreamSourceChannel,AbstractHttp2StreamSinkChannel>
- Throws:
IOException
-
writeBeforeHeaderBlock
protected void writeBeforeHeaderBlock(ByteBuffer buffer)
-
isFlushRequiredOnEmptyBuffer
protected boolean isFlushRequiredOnEmptyBuffer()
-
getHeaders
public HeaderMap getHeaders()
-
handleFlushComplete
protected void handleFlushComplete(boolean finalFrame)
- Overrides:
handleFlushComplete
in classHttp2StreamSinkChannel
-
channelForciblyClosed
protected void channelForciblyClosed() throws IOException
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
public org.xnio.ChannelListener<Http2DataStreamSinkChannel> getCompletionListener()
-
setCompletionListener
public void setCompletionListener(org.xnio.ChannelListener<Http2DataStreamSinkChannel> completionListener)
-
-