Top Description Fields Constructors Methods
io.undertow.protocols.http2

public abstract Class Http2StreamSinkChannel

extends AbstractHttp2StreamSinkChannel
Class Inheritance
Known Direct Subclasses
io.undertow.protocols.http2.Http2PrefaceStreamSinkChannel, io.undertow.protocols.http2.Http2DataStreamSinkChannel, io.undertow.protocols.http2.Http2SettingsStreamSinkChannel
Imports
java.io.IOException, java.nio.ByteBuffer, io.undertow.connector.PooledByteBuffer, io.undertow.server.protocol.framed.SendFrameHeader, org.xnio.IoUtils

Stream sink channel used for HTTP2 communication.
Authors
Stuart Douglas, Flavia Rainone

Field Summary

Modifier and TypeField and Description
private final Object
private int
private SendFrameHeader
private int
private volatile boolean
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
Http2StreamSinkChannel(Http2Channel channel, int streamId)

Method Summary

Modifier and TypeMethod and Description
protected PooledByteBuffer[]
allocateAll(PooledByteBuffer[] allHeaderBuffers, PooledByteBuffer currentBuffer)

protected void
channelForciblyClosed()

Overrides io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.channelForciblyClosed.

Called when a channel has been forcibly closed, and data (frames) have already been written.

pack-priv void
protected final SendFrameHeader
protected abstract SendFrameHeader
pack-priv SendFrameHeader
public int
protected int

Returns:

The number of bytes that can be sent
grabFlowControlBytes
(int toSend)

This method should be called before sending.

protected void
pack-priv void
rstStream()

Method that is invoked when the stream is reset.

pack-priv void
updateFlowControlWindow(final int delta)

Inherited from io.undertow.protocols.http2.AbstractHttp2StreamSinkChannel:
isLastFrame

Field Detail

flowControlLockback to summary
private final Object flowControlLock
flowControlWindowback to summary
private int flowControlWindow
initialWindowSizeback to summary
private int initialWindowSize
resetback to summary
private volatile boolean reset
streamIdback to summary
private final int streamId

Constructor Detail

Http2StreamSinkChannelback to summary
pack-priv Http2StreamSinkChannel(Http2Channel channel, int streamId)

Method Detail

allocateAllback to summary
protected PooledByteBuffer[] allocateAll(PooledByteBuffer[] allHeaderBuffers, PooledByteBuffer currentBuffer)
channelForciblyClosedback to summary
protected void channelForciblyClosed() throws IOException

Overrides io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.channelForciblyClosed.

Doc from io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.channelForciblyClosed.

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

Annotations
@Override
clearHeaderback to summary
pack-priv void clearHeader()
createFrameHeaderback to summary
protected final SendFrameHeader createFrameHeader()

Overrides io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.createFrameHeader.

Annotations
@Override
createFrameHeaderImplback to summary
protected abstract SendFrameHeader createFrameHeaderImpl()
generateSendFrameHeaderback to summary
pack-priv SendFrameHeader generateSendFrameHeader()
getStreamIdback to summary
public int getStreamId()
grabFlowControlBytesback to summary
protected int grabFlowControlBytes(int toSend)

This method should be called before sending. It will return the amount of data that can be sent, taking into account the stream and connection flow control windows, and the toSend parameter.

It will decrement the flow control windows by the amount that can be sent, so this method should only be called as a frame is being queued.

Returns:int

The number of bytes that can be sent

handleFlushCompleteback to summary
protected void handleFlushComplete(boolean channelClosed)

Overrides io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.handleFlushComplete.

Annotations
@Override
rstStreamback to summary
pack-priv void rstStream()

Method that is invoked when the stream is reset.

updateFlowControlWindowback to summary
pack-priv void updateFlowControlWindow(final int delta) throws IOException