Class AbstractH2StreamMultiplexer.H2StreamChannelImpl
java.lang.Object
org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.H2StreamChannelImpl
- All Implemented Interfaces:
Cancellable
,CapacityChannel
,DataStreamChannel
,StreamChannel<ByteBuffer>
,H2StreamChannel
- Enclosing class:
AbstractH2StreamMultiplexer
private class AbstractH2StreamMultiplexer.H2StreamChannelImpl
extends Object
implements H2StreamChannel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private final int
private boolean
private final AtomicInteger
private boolean
private final AtomicInteger
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionH2StreamChannelImpl
(int id, boolean idle, int initialInputWindowSize, int initialOutputWindowSize) -
Method Summary
Modifier and TypeMethodDescription(package private) void
appendState
(StringBuilder buf) boolean
cancel()
Cancels the ongoing operation or process.void
Terminates the underlying data stream and optionally writes a closing sequence.void
Terminates the underlying data stream and optionally writes a closing sequence with the given trailers.(package private) int
getId()
(package private) AtomicInteger
(package private) AtomicInteger
(package private) boolean
(package private) boolean
(package private) boolean
(package private) boolean
(package private) boolean
localReset
(int code) (package private) boolean
localReset
(H2Error error) void
push
(List<Header> headers, AsyncPushProducer pushProducer) void
Signals intent by the data producer to produce more data.(package private) void
(package private) void
void
toString()
void
update
(int increment) Updates data capacity information through this channel.int
write
(ByteBuffer payload) Writes data from the buffer through this channel into the underlying byte stream.
-
Field Details
-
id
private final int id -
inputWindow
-
outputWindow
-
idle
private volatile boolean idle -
remoteEndStream
private volatile boolean remoteEndStream -
localEndStream
private volatile boolean localEndStream -
deadline
private volatile long deadline
-
-
Constructor Details
-
H2StreamChannelImpl
H2StreamChannelImpl(int id, boolean idle, int initialInputWindowSize, int initialOutputWindowSize)
-
-
Method Details
-
getId
int getId() -
getOutputWindow
AtomicInteger getOutputWindow() -
getInputWindow
AtomicInteger getInputWindow() -
submit
- Specified by:
submit
in interfaceH2StreamChannel
- Throws:
IOException
-
push
public void push(List<Header> headers, AsyncPushProducer pushProducer) throws HttpException, IOException - Specified by:
push
in interfaceH2StreamChannel
- Throws:
HttpException
IOException
-
update
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 interfaceCapacityChannel
- Parameters:
increment
- non-negative number of extra bytes the consumer can accept.- Throws:
IOException
-
write
Description copied from interface:DataStreamChannel
Writes data from the buffer through this channel into the underlying byte stream. If the underlying byte stream is temporarily unable to accept more data it can return zero to indicate that no data could be written to the data stream. The data producer can choose to callDataStreamChannel.requestOutput()
to signal its intent to produce more data.- Specified by:
write
in interfaceDataStreamChannel
- Specified by:
write
in interfaceStreamChannel<ByteBuffer>
- Parameters:
payload
- source of data- Returns:
- The number of bytes written, possibly zero
- Throws:
IOException
-
endStream
Description copied from interface:DataStreamChannel
Terminates the underlying data stream and optionally writes a closing sequence with the given trailers.Please note that some data streams may not support trailers and may silently ignore the trailers parameter.
- Specified by:
endStream
in interfaceDataStreamChannel
- Throws:
IOException
-
endStream
Description copied from interface:StreamChannel
Terminates the underlying data stream and optionally writes a closing sequence.- Specified by:
endStream
in interfaceStreamChannel<ByteBuffer>
- Throws:
IOException
-
requestOutput
public void requestOutput()Description copied from interface:DataStreamChannel
Signals intent by the data producer to produce more data. Once the channel is able to accept data its handler is expected to trigger an event to notify the data producer.- Specified by:
requestOutput
in interfaceDataStreamChannel
-
isRemoteClosed
boolean isRemoteClosed() -
setRemoteEndStream
void setRemoteEndStream() -
isLocalClosed
boolean isLocalClosed() -
setLocalEndStream
void setLocalEndStream() -
isLocalReset
boolean isLocalReset() -
isResetDeadline
boolean isResetDeadline() -
localReset
- Throws:
IOException
-
localReset
- Throws:
IOException
-
cancel
public boolean cancel()Description copied from interface:Cancellable
Cancels the ongoing operation or process.- Specified by:
cancel
in interfaceCancellable
- Returns:
true
if the operation or process has been cancelled as a result of this method call orfalse
if it has already been cancelled or not started.
-
appendState
-
toString
-