Top Description Methods
org.glassfish.grizzly.http2

pack-priv Interface StreamOutputSink

Known Direct Implementers
org.glassfish.grizzly.http2.UpgradeOutputSink, org.glassfish.grizzly.http2.DefaultOutputSink
Imports
java.io.IOException, org.glassfish.grizzly.Buffer, .CompletionHandler, .WriteHandler, .WriteResult, org.glassfish.grizzly.asyncqueue.MessageCloner, org.glassfish.grizzly.filterchain.FilterChainContext, org.glassfish.grizzly.http.HttpPacket

Interface represents an output sink associated with specific Http2Stream.
Author
Alexey Stashok

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
close()

Closes the output sink by adding last DataFrame with the FIN flag to a queue.

public void
flush(CompletionHandler<Http2Stream>
CompletionHandler to be notified
completionHandler
)

Flush Http2Stream output and notify CompletionHandler once all output data has been flushed.

public int
getUnflushedWritesCount()

Returns: the number of writes (not bytes), that haven't reached network layer

public boolean
public void
public void
onPeerWindowUpdate(int
the delta.
delta
)

The method is called by HTTP2 Filter once WINDOW_UPDATE message comes for this Http2Stream.

public void
terminate(Termination terminationFlag)

Unlike close() this method forces the output sink termination by setting termination flag and canceling all the pending writes.

public void
writeDownStream(HttpPacket httpPacket, FilterChainContext ctx, CompletionHandler<WriteResult<K, L>> completionHandler, MessageCloner<Buffer> messageCloner)

Method Detail

canWriteback to summary
public boolean canWrite()
closeback to summary
public void close()

Closes the output sink by adding last DataFrame with the FIN flag to a queue. If the output sink is already closed - method does nothing.

flushback to summary
public void flush(CompletionHandler<Http2Stream> completionHandler)

Flush Http2Stream output and notify CompletionHandler once all output data has been flushed.

Parameters
completionHandler:CompletionHandler<Http2Stream>

CompletionHandler to be notified

getUnflushedWritesCountback to summary
public int getUnflushedWritesCount()
Returns:int

the number of writes (not bytes), that haven't reached network layer

isClosedback to summary
public boolean isClosed()
notifyWritePossibleback to summary
public void notifyWritePossible(WriteHandler writeHandler)
onPeerWindowUpdateback to summary
public void onPeerWindowUpdate(int delta) throws Http2StreamException

The method is called by HTTP2 Filter once WINDOW_UPDATE message comes for this Http2Stream.

Parameters
delta:int

the delta.

Exceptions
Http2StreamException:
if an error occurs processing the window update.
terminateback to summary
public void terminate(Termination terminationFlag)

Unlike close() this method forces the output sink termination by setting termination flag and canceling all the pending writes.

writeDownStreamback to summary
public void writeDownStream(HttpPacket httpPacket, FilterChainContext ctx, CompletionHandler<WriteResult<K, L>> completionHandler, MessageCloner<Buffer> messageCloner) throws IOException