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 java.lang.Object implements CapacityChannel
-
-
Constructor Summary
Constructors Constructor Description CapacityWindow(int window, IOSession ioSession)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclose()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) intgetWindow()(package private) intremoveCapacity(int delta)Internal method for removing capacity.voidupdate(int increment)Updates data capacity information through this channel.private voidupdateWindow(int delta)
-
-
-
Field Detail
-
ioSession
private final IOSession ioSession
-
lock
private final java.lang.Object lock
-
window
private int window
-
closed
private boolean closed
-
-
Constructor Detail
-
CapacityWindow
CapacityWindow(int window, IOSession ioSession)
-
-
Method Detail
-
update
public void update(int increment) throws java.io.IOExceptionDescription copied from interface:CapacityChannelUpdates 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:
updatein interfaceCapacityChannel- Parameters:
increment- non-negative number of extra bytes the consumer can accept.- Throws:
java.io.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()
-
-