Class AbstractHttp1StreamDuplexer.CapacityWindow

java.lang.Object
org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.CapacityWindow
All Implemented Interfaces:
CapacityChannel
Enclosing class:
AbstractHttp1StreamDuplexer<IncomingMessage extends HttpMessage, OutgoingMessage extends HttpMessage>

static class AbstractHttp1StreamDuplexer.CapacityWindow extends Object implements CapacityChannel
  • Field Details

    • ioSession

      private final IOSession ioSession
    • lock

      private final ReentrantLock lock
    • window

      private int window
    • closed

      private boolean closed
  • Constructor Details

    • CapacityWindow

      CapacityWindow(int window, IOSession ioSession)
  • Method Details

    • update

      public void update(int increment) throws IOException
      Description copied from interface: CapacityChannel
      Updates data capacity information through this channel. The total number of bytes the consumer is capable of accepting is incremented by the given increment number.
      Specified by:
      update in interface CapacityChannel
      Parameters:
      increment - non-negative number of extra bytes the consumer can accept.
      Throws:
      IOException - in case of an I/O error.
    • removeCapacity

      int removeCapacity(int delta)
      Internal method for removing capacity. We don't need to check if this channel is closed in it.
    • updateWindow

      private void updateWindow(int delta)
    • close

      void close()
      Closes the capacity channel, preventing user code from accidentally requesting read events outside of the context of the request the channel was created for
    • getWindow

      int getWindow()