Top Description Fields Constructors Methods
org.glassfish.grizzly.http2

public Class UpgradeOutputSink

extends Object
implements StreamOutputSink
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.http2.StreamOutputSink
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

The StreamOutputSink implementation, which is used when upgrading HTTP -> HTTP/2 connections.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private final Http2Session
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.glassfish.grizzly.http2.StreamOutputSink.close.

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

public void
flush(CompletionHandler<Http2Stream> completionHandler)

Implements org.glassfish.grizzly.http2.StreamOutputSink.flush.

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

public int
public synchronized boolean
public void
public void
onPeerWindowUpdate(int delta)

Implements org.glassfish.grizzly.http2.StreamOutputSink.onPeerWindowUpdate.

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

public void
terminate(Termination termination)

Implements org.glassfish.grizzly.http2.StreamOutputSink.terminate.

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

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionback to summary
private final Http2Session connection
isClosedback to summary
private boolean isClosed

Constructor Detail

UpgradeOutputSinkback to summary
public UpgradeOutputSink(Http2Session connection)

Method Detail

canWriteback to summary
public boolean canWrite()

Implements org.glassfish.grizzly.http2.StreamOutputSink.canWrite.

Annotations
@Override
closeback to summary
public void close()

Implements org.glassfish.grizzly.http2.StreamOutputSink.close.

Doc from org.glassfish.grizzly.http2.StreamOutputSink.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.

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

Implements org.glassfish.grizzly.http2.StreamOutputSink.flush.

Doc from org.glassfish.grizzly.http2.StreamOutputSink.flush.

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

Annotations
@Override
getUnflushedWritesCountback to summary
public int getUnflushedWritesCount()

Implements org.glassfish.grizzly.http2.StreamOutputSink.getUnflushedWritesCount.

Annotations
@Override
isClosedback to summary
public synchronized boolean isClosed()

Implements org.glassfish.grizzly.http2.StreamOutputSink.isClosed.

Annotations
@Override
notifyWritePossibleback to summary
public void notifyWritePossible(WriteHandler writeHandler)

Implements org.glassfish.grizzly.http2.StreamOutputSink.notifyWritePossible.

Annotations
@Override
onPeerWindowUpdateback to summary
public void onPeerWindowUpdate(int delta) throws Http2StreamException

Implements org.glassfish.grizzly.http2.StreamOutputSink.onPeerWindowUpdate.

Doc from org.glassfish.grizzly.http2.StreamOutputSink.onPeerWindowUpdate.

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

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

Implements org.glassfish.grizzly.http2.StreamOutputSink.terminate.

Doc from org.glassfish.grizzly.http2.StreamOutputSink.terminate.

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

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

Implements org.glassfish.grizzly.http2.StreamOutputSink.writeDownStream.

Annotations
@Override