protected abstract static class AbstractServerStream.TransportState extends AbstractStream.TransportState
AbstractServerStream
).DEFAULT_ONREADY_THRESHOLD
Modifier | Constructor and Description |
---|---|
protected |
TransportState(int maxMessageSize,
StatsTraceContext statsTraceCtx,
TransportTracer transportTracer) |
Modifier and Type | Method and Description |
---|---|
void |
complete()
Indicates the stream is considered completely closed and there is no further opportunity for
error.
|
void |
deframerClosed(boolean hasPartialMessage)
Called when the deframer closes.
|
void |
inboundDataReceived(ReadableBuffer frame,
boolean endOfStream)
Called in the transport thread to process the content of an inbound DATA frame from the
client.
|
protected ServerStreamListener |
listener()
Override this method to provide a stream listener.
|
void |
onStreamAllocated()
Event handler to be called by the subclass when the stream's headers have passed any
connection flow control (i.e., MAX_CONCURRENT_STREAMS).
|
void |
runOnTransportThread(Runnable r) |
void |
setListener(ServerStreamListener listener)
Sets the listener to receive notifications.
|
void |
transportReportStatus(Status status)
Notifies failure to the listener of the stream.
|
closeDeframer, deframe, getStatsTraceContext, getTransportTracer, messagesAvailable, onSentBytes, onStreamDeallocated, requestMessagesFromDeframer, setDecompressor, setFullStreamDecompressor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bytesRead, deframeFailed
protected TransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer)
public final void setListener(ServerStreamListener listener)
public final void onStreamAllocated()
AbstractStream.TransportState
StreamListener.onReady()
handler if appropriate. This must be called from the transport
thread, since the listener may be called back directly.onStreamAllocated
in class AbstractStream.TransportState
public void deframerClosed(boolean hasPartialMessage)
MessageDeframer.Listener
hasPartialMessage
- whether the deframer contained an incomplete message at closing.protected ServerStreamListener listener()
AbstractStream.TransportState
listener
in class AbstractStream.TransportState
public void inboundDataReceived(ReadableBuffer frame, boolean endOfStream)
frame
- the inbound HTTP/2 DATA frame. If this buffer is not used immediately, it must
be retained.endOfStream
- true
if no more data will be received on the stream.public final void transportReportStatus(Status status)
Unlike AbstractServerStream.close(Status, Metadata)
, this method is only called from the
transport. The transport should use this method instead of close(Status)
for internal
errors to prevent exposing unexpected states and exceptions to the application.
status
- the error status. Must not be Status.OK
.public void complete()
closed()
if it was not already done by transportReportStatus(io.grpc.Status)
.public void runOnTransportThread(Runnable r)