Class AbstractClientStream.TransportState

    • Field Detail

      • statsTraceCtx

        private final StatsTraceContext statsTraceCtx
        Whether listener.closed() has been called.
      • listenerClosed

        private boolean listenerClosed
      • fullStreamDecompression

        private boolean fullStreamDecompression
      • deframerClosed

        private boolean deframerClosed
      • deframerClosedTask

        private java.lang.Runnable deframerClosedTask
      • outboundClosed

        private volatile boolean outboundClosed
        Whether the client has half-closed the stream.
      • statusReported

        private boolean statusReported
        Whether the stream is closed from the transport's perspective. This can differ from listenerClosed because there may still be messages buffered to deliver to the application.
    • Method Detail

      • setFullStreamDecompression

        private void setFullStreamDecompression​(boolean fullStreamDecompression)
      • setDecompressorRegistry

        private void setDecompressorRegistry​(DecompressorRegistry decompressorRegistry)
      • 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.
      • setOutboundClosed

        private final void setOutboundClosed()
      • 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
      • closeListener

        private void closeListener​(Status status,
                                   ClientStreamListener.RpcProgress rpcProgress,
                                   Metadata trailers)
        Closes the listener if not previously closed.
        Throws:
        java.lang.IllegalStateException - if the call has not yet been started.