Package io.grpc.internal
Class AbstractClientStream.TransportState
java.lang.Object
io.grpc.internal.AbstractStream.TransportState
io.grpc.internal.AbstractClientStream.TransportState
- All Implemented Interfaces:
io.grpc.internal.ApplicationThreadDeframerListener.TransportExecutor
,MessageDeframer.Listener
- Direct Known Subclasses:
Http2ClientStreamTransportState
- Enclosing class:
AbstractClientStream
protected abstract static class AbstractClientStream.TransportState
extends AbstractStream.TransportState
This should only be called from the transport thread.
-
Field Summary
Fields inherited from class io.grpc.internal.AbstractStream.TransportState
DEFAULT_ONREADY_THRESHOLD
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TransportState
(int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, CallOptions options) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deframerClosed
(boolean hasPartialMessage) Called when the deframer closes.protected void
Processes the contents of a received data frame from the server.protected void
inboundHeadersReceived
(Metadata headers) Called by transport implementations when they receive headers.protected void
inboundTrailersReceived
(Metadata trailers, Status status) Processes the trailers and status from the server.protected final boolean
protected final ClientStreamListener
listener()
Override this method to provide a stream listener.final void
setListener
(ClientStreamListener listener) final void
transportReportStatus
(Status status, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported.final void
transportReportStatus
(Status status, ClientStreamListener.RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported.Methods inherited from class io.grpc.internal.AbstractStream.TransportState
closeDeframer, deframe, getStatsTraceContext, getTransportTracer, isStreamDeallocated, messagesAvailable, onSentBytes, onStreamAllocated, onStreamDeallocated, requestMessagesFromDeframerForTesting, setDecompressor, setFullStreamDecompressor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.grpc.internal.ApplicationThreadDeframerListener.TransportExecutor
runOnTransportThread
Methods inherited from interface io.grpc.internal.MessageDeframer.Listener
bytesRead, deframeFailed
-
Constructor Details
-
TransportState
protected TransportState(int maxMessageSize, StatsTraceContext statsTraceCtx, TransportTracer transportTracer, CallOptions options)
-
-
Method Details
-
setListener
-
deframerClosed
public void deframerClosed(boolean hasPartialMessage) Description copied from interface:MessageDeframer.Listener
Called when the deframer closes.- Parameters:
hasPartialMessage
- whether the deframer contained an incomplete message at closing.
-
listener
Description copied from class:AbstractStream.TransportState
Override this method to provide a stream listener.- Specified by:
listener
in classAbstractStream.TransportState
-
isOutboundClosed
protected final boolean isOutboundClosed() -
inboundHeadersReceived
Called by transport implementations when they receive headers.- Parameters:
headers
- the parsed headers
-
inboundDataReceived
Processes the contents of a received data frame from the server.- Parameters:
frame
- the received data frame. Its ownership is transferred to this method.
-
inboundTrailersReceived
Processes the trailers and status from the server.- Parameters:
trailers
- the received trailersstatus
- the status extracted from the trailers
-
transportReportStatus
Report stream closure with status to the application layer if not already reported. This method must be called from the transport thread.- Parameters:
status
- the new status to setstopDelivery
- iftrue
, interrupts any further delivery of inbound messages that may already be queued up in the deframer. Iffalse
, the listener will be notified immediately after all currently completed messages in the deframer have been delivered to the application.trailers
- new instance ofTrailers
, either empty or those returned by the server
-
transportReportStatus
public final void transportReportStatus(Status status, ClientStreamListener.RpcProgress rpcProgress, boolean stopDelivery, Metadata trailers) Report stream closure with status to the application layer if not already reported. This method must be called from the transport thread.- Parameters:
status
- the new status to setrpcProgress
- RPC progress that theClientStreamListener.closed(Status, RpcProgress, Metadata)
will receivestopDelivery
- iftrue
, interrupts any further delivery of inbound messages that may already be queued up in the deframer and overrides any previously queued status. Iffalse
, the listener will be notified immediately after all currently completed messages in the deframer have been delivered to the application.trailers
- new instance ofTrailers
, either empty or those returned by the server
-