Class AbstractH2StreamMultiplexer.H2StreamChannelImpl
- java.lang.Object
-
- org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.H2StreamChannelImpl
-
- All Implemented Interfaces:
Cancellable,CapacityChannel,DataStreamChannel,StreamChannel<java.nio.ByteBuffer>,H2StreamChannel
- Enclosing class:
- AbstractH2StreamMultiplexer
class AbstractH2StreamMultiplexer.H2StreamChannelImpl extends java.lang.Object implements H2StreamChannel
-
-
Field Summary
Fields Modifier and Type Field Description private intidprivate java.util.concurrent.atomic.AtomicIntegerinputWindowprivate booleanlocalClosedprivate longlocalResetTimeprivate java.util.concurrent.atomic.AtomicIntegeroutputWindow
-
Constructor Summary
Constructors Constructor Description H2StreamChannelImpl(int id, int initialInputWindowSize, int initialOutputWindowSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()Cancels the ongoing operation or process.voidendStream()Terminates the underlying data stream and optionally writes a closing sequence.voidendStream(java.util.List<? extends Header> trailers)Terminates the underlying data stream and optionally writes a closing sequence with the given trailers.(package private) voidensureNotClosed()intgetId()java.util.concurrent.atomic.AtomicIntegergetInputWindow()longgetLocalResetTime()java.util.concurrent.atomic.AtomicIntegergetOutputWindow()booleanisLocalClosed()booleanlocalReset(int code)voidmarkLocalClosed()voidpush(java.util.List<Header> headers, AsyncPushProducer pushProducer)voidrequestOutput()Signals intent by the data producer to produce more data.voidsubmit(java.util.List<Header> headers, boolean endStream)java.lang.StringtoString()voidupdate(int increment)Updates data capacity information through this channel.intwrite(java.nio.ByteBuffer payload)Writes data from the buffer through this channel into the underlying byte stream.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.hc.core5.http2.impl.nio.H2StreamChannel
isLocalReset, localReset, terminate
-
-
-
-
Method Detail
-
getId
public int getId()
- Specified by:
getIdin interfaceH2StreamChannel
-
getOutputWindow
public java.util.concurrent.atomic.AtomicInteger getOutputWindow()
- Specified by:
getOutputWindowin interfaceH2StreamChannel
-
getInputWindow
public java.util.concurrent.atomic.AtomicInteger getInputWindow()
- Specified by:
getInputWindowin interfaceH2StreamChannel
-
ensureNotClosed
void ensureNotClosed() throws H2ConnectionException- Throws:
H2ConnectionException
-
submit
public void submit(java.util.List<Header> headers, boolean endStream) throws java.io.IOException
- Specified by:
submitin interfaceH2StreamChannel- Throws:
java.io.IOException
-
push
public void push(java.util.List<Header> headers, AsyncPushProducer pushProducer) throws HttpException, java.io.IOException
- Specified by:
pushin interfaceH2StreamChannel- Throws:
HttpExceptionjava.io.IOException
-
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- in case of an I/O error.
-
write
public int write(java.nio.ByteBuffer payload) throws java.io.IOExceptionDescription copied from interface:DataStreamChannelWrites 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:
writein interfaceDataStreamChannel- Specified by:
writein interfaceStreamChannel<java.nio.ByteBuffer>- Parameters:
payload- source of data- Returns:
- The number of bytes written, possibly zero
- Throws:
java.io.IOException- in case of an I/O error.
-
endStream
public void endStream(java.util.List<? extends Header> trailers) throws java.io.IOException
Description copied from interface:DataStreamChannelTerminates 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:
endStreamin interfaceDataStreamChannel- Throws:
java.io.IOException- in case of an I/O error.
-
endStream
public void endStream() throws java.io.IOExceptionDescription copied from interface:StreamChannelTerminates the underlying data stream and optionally writes a closing sequence.- Specified by:
endStreamin interfaceStreamChannel<java.nio.ByteBuffer>- Throws:
java.io.IOException- in case of an I/O error.
-
requestOutput
public void requestOutput()
Description copied from interface:DataStreamChannelSignals 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:
requestOutputin interfaceDataStreamChannel
-
isLocalClosed
public boolean isLocalClosed()
- Specified by:
isLocalClosedin interfaceH2StreamChannel
-
markLocalClosed
public void markLocalClosed()
- Specified by:
markLocalClosedin interfaceH2StreamChannel
-
localReset
public boolean localReset(int code) throws java.io.IOException- Specified by:
localResetin interfaceH2StreamChannel- Throws:
java.io.IOException
-
getLocalResetTime
public long getLocalResetTime()
- Specified by:
getLocalResetTimein interfaceH2StreamChannel
-
cancel
public boolean cancel()
Description copied from interface:CancellableCancels the ongoing operation or process.- Specified by:
cancelin interfaceCancellable- Returns:
trueif the operation or process has been cancelled as a result of this method call orfalseif it has already been cancelled or not started.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-