Class AbstractListenerServerHttpResponse
- java.lang.Object
- org.springframework.http.server.reactive.AbstractServerHttpResponse
- org.springframework.http.server.reactive.AbstractListenerServerHttpResponse
- All Implemented Interfaces:
HttpMessage
,ReactiveHttpOutputMessage
,ServerHttpResponse
public abstract class AbstractListenerServerHttpResponse extends AbstractServerHttpResponse
Abstract base class for listener-based server responses, e.g. Servlet 3.1 and Undertow.- Since:
- 5.0
- Author:
- Arjen Poutsma
Field Summary
Fields inherited from class org.springframework.http.server.reactive.AbstractServerHttpResponse
logger
Constructor Summary
Constructors Constructor Description AbstractListenerServerHttpResponse(DataBufferFactory dataBufferFactory)
AbstractListenerServerHttpResponse(DataBufferFactory dataBufferFactory, HttpHeaders headers)
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.reactivestreams.Processor<? super org.reactivestreams.Publisher<? extends DataBuffer>,Void>
createBodyFlushProcessor()
Abstract template method to create aProcessor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output.protected reactor.core.publisher.Mono<Void>
writeAndFlushWithInternal(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
Write to the underlying the response, and flush after eachPublisher<DataBuffer>
.protected reactor.core.publisher.Mono<Void>
writeWithInternal(org.reactivestreams.Publisher<? extends DataBuffer> body)
Write to the underlying the response.Methods inherited from class org.springframework.http.server.reactive.AbstractServerHttpResponse
addCookie, applyCookies, applyHeaders, applyStatusCode, beforeCommit, bufferFactory, doCommit, doCommit, getCookies, getHeaders, getNativeResponse, getRawStatusCode, getStatusCode, getStatusCodeValue, isCommitted, setComplete, setRawStatusCode, setStatusCode, setStatusCodeValue, writeAndFlushWith, writeWith
Constructor Detail
AbstractListenerServerHttpResponse
public AbstractListenerServerHttpResponse(DataBufferFactory dataBufferFactory)
AbstractListenerServerHttpResponse
public AbstractListenerServerHttpResponse(DataBufferFactory dataBufferFactory, HttpHeaders headers)
Method Detail
writeWithInternal
protected final reactor.core.publisher.Mono<Void> writeWithInternal(org.reactivestreams.Publisher<? extends DataBuffer> body)
Description copied from class:AbstractServerHttpResponse
Write to the underlying the response.- Specified by:
writeWithInternal
in classAbstractServerHttpResponse
- Parameters:
body
- the publisher to write with
writeAndFlushWithInternal
protected final reactor.core.publisher.Mono<Void> writeAndFlushWithInternal(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends DataBuffer>> body)
Description copied from class:AbstractServerHttpResponse
Write to the underlying the response, and flush after eachPublisher<DataBuffer>
.- Specified by:
writeAndFlushWithInternal
in classAbstractServerHttpResponse
- Parameters:
body
- the publisher to write and flush with
createBodyFlushProcessor
protected abstract org.reactivestreams.Processor<? super org.reactivestreams.Publisher<? extends DataBuffer>,Void> createBodyFlushProcessor()
Abstract template method to create aProcessor<Publisher<DataBuffer>, Void>
that will write the response body with flushes to the underlying output. Called fromwriteAndFlushWithInternal(Publisher)
.