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

pack-priv Class UpgradeInputBuffer

extends Object
implements StreamInputBuffer
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.http2.StreamInputBuffer
Imports
java.io.IOException, org.glassfish.grizzly.Buffer, org.glassfish.grizzly.http.HttpContent

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

Field Summary

Modifier and TypeField and Description
private boolean
private final Http2Stream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close(Termination termination)

Implements org.glassfish.grizzly.http2.StreamInputBuffer.close.

Graceful input buffer close.

public synchronized boolean
isClosed()

Implements org.glassfish.grizzly.http2.StreamInputBuffer.isClosed.

Returns true if the InputBuffer has been closed.

public boolean
offer(Buffer data, boolean isLast)

Implements org.glassfish.grizzly.http2.StreamInputBuffer.offer.

The method is called, when new input data arrives.

public void
onReadEventComplete()

Implements org.glassfish.grizzly.http2.StreamInputBuffer.onReadEventComplete.

The method will be invoked once upstream completes READ operation processing.

public HttpContent
poll()

Implements org.glassfish.grizzly.http2.StreamInputBuffer.poll.

Retrieves available input buffer payload, waiting up to the Connection#getReadTimeout(java.util.concurrent.TimeUnit) wait time if necessary for payload to become available.

public void
terminate(Termination termination)

Implements org.glassfish.grizzly.http2.StreamInputBuffer.terminate.

Forcibly closes the input buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isClosedback to summary
private boolean isClosed
streamback to summary
private final Http2Stream stream

Constructor Detail

UpgradeInputBufferback to summary
pack-priv UpgradeInputBuffer(final Http2Stream stream)

Method Detail

closeback to summary
public void close(Termination termination)

Implements org.glassfish.grizzly.http2.StreamInputBuffer.close.

Doc from org.glassfish.grizzly.http2.StreamInputBuffer.close.

Graceful input buffer close. Marks the input buffer as closed by adding Termination input element to the input queue.

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

Implements org.glassfish.grizzly.http2.StreamInputBuffer.isClosed.

Doc from org.glassfish.grizzly.http2.StreamInputBuffer.isClosed.

Returns true if the InputBuffer has been closed.

Annotations
@Override
offerback to summary
public boolean offer(Buffer data, boolean isLast)

Implements org.glassfish.grizzly.http2.StreamInputBuffer.offer.

Doc from org.glassfish.grizzly.http2.StreamInputBuffer.offer.

The method is called, when new input data arrives.

Annotations
@Override
onReadEventCompleteback to summary
public void onReadEventComplete()

Implements org.glassfish.grizzly.http2.StreamInputBuffer.onReadEventComplete.

Doc from org.glassfish.grizzly.http2.StreamInputBuffer.onReadEventComplete.

The method will be invoked once upstream completes READ operation processing. Here we have to simulate NIO OP_READ event re-registration.

Annotations
@Override
pollback to summary
public HttpContent poll() throws IOException

Implements org.glassfish.grizzly.http2.StreamInputBuffer.poll.

Doc from org.glassfish.grizzly.http2.StreamInputBuffer.poll.

Retrieves available input buffer payload, waiting up to the Connection#getReadTimeout(java.util.concurrent.TimeUnit) wait time if necessary for payload to become available.

Annotations
@Override
Exceptions
IOException:
if an error occurs during the poll operation.
terminateback to summary
public void terminate(Termination termination)

Implements org.glassfish.grizzly.http2.StreamInputBuffer.terminate.

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

Forcibly closes the input buffer. All the buffered data will be discarded.

Annotations
@Override