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.
  • Constructor Details

  • Method Details

    • setListener

      public final void setListener(ClientStreamListener listener)
    • 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

      protected final ClientStreamListener listener()
      Description copied from class: AbstractStream.TransportState
      Override this method to provide a stream listener.
      Specified by:
      listener in class AbstractStream.TransportState
    • isOutboundClosed

      protected final boolean isOutboundClosed()
    • inboundHeadersReceived

      protected void inboundHeadersReceived(Metadata headers)
      Called by transport implementations when they receive headers.
      Parameters:
      headers - the parsed headers
    • inboundDataReceived

      protected void inboundDataReceived(ReadableBuffer frame)
      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

      protected void inboundTrailersReceived(Metadata trailers, Status status)
      Processes the trailers and status from the server.
      Parameters:
      trailers - the received trailers
      status - the status extracted from the trailers
    • transportReportStatus

      public final void transportReportStatus(Status status, 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 set
      stopDelivery - if true, interrupts any further delivery of inbound messages that may already be queued up in the deframer. If false, the listener will be notified immediately after all currently completed messages in the deframer have been delivered to the application.
      trailers - new instance of Trailers, 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 set
      rpcProgress - RPC progress that the ClientStreamListener.closed(Status, RpcProgress, Metadata) will receive
      stopDelivery - if true, interrupts any further delivery of inbound messages that may already be queued up in the deframer and overrides any previously queued status. If false, the listener will be notified immediately after all currently completed messages in the deframer have been delivered to the application.
      trailers - new instance of Trailers, either empty or those returned by the server