private class UndertowServerHttpResponse.ResponseBodyProcessor extends AbstractListenerWriteProcessor<DataBuffer>
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
byteBuffer |
private StreamSinkChannel |
channel |
currentData, logger
Constructor and Description |
---|
ResponseBodyProcessor(StreamSinkChannel channel) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isDataEmpty(DataBuffer dataBuffer)
Whether the given data item contains any actual data to be processed.
|
protected boolean |
isWritePossible()
Whether writing is possible.
|
protected void |
receiveData(DataBuffer dataBuffer)
Called when a data item is received via
Subscriber#onNext(Object) |
protected void |
releaseData()
Called when the current received data item can be released.
|
protected void |
suspendWriting()
Suspend writing.
|
protected boolean |
write(DataBuffer dataBuffer)
Writes the given data to the output.
|
private int |
writeByteBuffer(java.nio.ByteBuffer byteBuffer) |
protected void |
writingComplete()
Invoked when writing is complete.
|
protected void |
writingFailed(java.lang.Throwable ex)
Invoked when an error happens while writing.
|
cancel, onComplete, onError, onNext, onSubscribe, onWritePossible, subscribe
private final StreamSinkChannel channel
@Nullable private volatile java.nio.ByteBuffer byteBuffer
protected boolean isWritePossible()
AbstractListenerWriteProcessor
isWritePossible
in class AbstractListenerWriteProcessor<DataBuffer>
protected boolean write(DataBuffer dataBuffer) throws java.io.IOException
AbstractListenerWriteProcessor
write
in class AbstractListenerWriteProcessor<DataBuffer>
dataBuffer
- the data to writetrue
)
and new data can be requested, or otherwise (false
)java.io.IOException
private int writeByteBuffer(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
java.io.IOException
protected void receiveData(DataBuffer dataBuffer)
AbstractListenerWriteProcessor
Subscriber#onNext(Object)
receiveData
in class AbstractListenerWriteProcessor<DataBuffer>
protected void releaseData()
AbstractListenerWriteProcessor
releaseData
in class AbstractListenerWriteProcessor<DataBuffer>
protected boolean isDataEmpty(DataBuffer dataBuffer)
AbstractListenerWriteProcessor
isDataEmpty
in class AbstractListenerWriteProcessor<DataBuffer>
protected void suspendWriting()
AbstractListenerWriteProcessor
suspendWriting
in class AbstractListenerWriteProcessor<DataBuffer>
protected void writingComplete()
AbstractListenerWriteProcessor
writingComplete
in class AbstractListenerWriteProcessor<DataBuffer>
protected void writingFailed(java.lang.Throwable ex)
AbstractListenerWriteProcessor
Defaults to no-op. Servlet 3.1 based implementations will receive
javax.servlet.WriteListener#onError(Throwable)
event.
writingFailed
in class AbstractListenerWriteProcessor<DataBuffer>