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 Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    private final IOSession
     
    private final Object
     
    private int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CapacityWindow(int window, IOSession ioSession)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Closes the capacity channel, preventing user code from accidentally requesting read events outside of the context of the request the channel was created for
    (package private) int
     
    (package private) int
    removeCapacity(int delta)
    Internal method for removing capacity.
    void
    update(int increment)
    Updates data capacity information through this channel.
    private void
    updateWindow(int delta)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ioSession

      private final IOSession ioSession
    • lock

      private final Object 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
    • 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()