类 ReactorServerHttpResponse
java.lang.Object
cn.taketoday.http.server.reactive.AbstractServerHttpResponse
cn.taketoday.http.server.reactive.ReactorServerHttpResponse
class ReactorServerHttpResponse
extends AbstractServerHttpResponse
implements ZeroCopyHttpOutputMessage
Adapt
ServerHttpResponse to the HttpServerResponse.- 从以下版本开始:
- 4.0
- 作者:
- Stephane Maldini, Rossen Stoyanchev
-
字段概要
字段 -
构造器概要
构造器构造器说明ReactorServerHttpResponse(reactor.netty.http.server.HttpServerResponse response, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory) -
方法概要
修饰符和类型方法说明protected voidAdd cookies fromAbstractServerHttpResponse.getHeaders()to the underlying response.protected voidInvoked when the response is getting committed allowing sub-classes to make apply header values to the underlying response.protected voidWrite the status code to the underlying response.<T> TReturn the underlying server response.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.Return the status code that has been set, or otherwise fall back on the status of the response from the underlying server.private org.reactivestreams.Publisher<io.netty.buffer.ByteBuf>toByteBuf(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> dataBuffers) protected voidtouchDataBuffer(cn.taketoday.core.io.buffer.DataBuffer buffer) Allow sub-classes to associate a hint with the data buffer if it is a pooled buffer and supports leak tracking.protected reactor.core.publisher.Mono<Void>writeAndFlushWithInternal(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> publisher) Write to the underlying the response, and flush after eachPublisher<DataBuffer>.reactor.core.publisher.Mono<Void>Use the givenPathto write the body of the message to the underlying HTTP layer.protected reactor.core.publisher.Mono<Void>writeWithInternal(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> publisher) Write to the underlying the response.从类继承的方法 cn.taketoday.http.server.reactive.AbstractServerHttpResponse
addCookie, beforeCommit, bufferFactory, doCommit, doCommit, getCookies, getHeaders, isCommitted, setComplete, setRawStatusCode, setStatusCode, writeAndFlushWith, writeWith从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.HttpMessage
getHeaders从接口继承的方法 cn.taketoday.http.ReactiveHttpOutputMessage
beforeCommit, bufferFactory, isCommitted, setComplete, writeAndFlushWith, writeWith从接口继承的方法 cn.taketoday.http.ZeroCopyHttpOutputMessage
writeWith
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger -
response
private final reactor.netty.http.server.HttpServerResponse response
-
-
构造器详细资料
-
ReactorServerHttpResponse
public ReactorServerHttpResponse(reactor.netty.http.server.HttpServerResponse response, cn.taketoday.core.io.buffer.DataBufferFactory bufferFactory)
-
-
方法详细资料
-
getNativeResponse
public <T> T getNativeResponse()从类复制的说明:AbstractServerHttpResponseReturn the underlying server response. -
getStatusCode
从接口复制的说明:ServerHttpResponseReturn the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may benullif the status code value is outside theHttpStatusenum range, or if there is no default value from the underlying server.- 指定者:
getStatusCode在接口中ServerHttpResponse- 覆盖:
getStatusCode在类中AbstractServerHttpResponse
-
getRawStatusCode
从接口复制的说明:ServerHttpResponseReturn the status code that has been set, or otherwise fall back on the status of the response from the underlying server. The return value may benullif there is no default value from the underlying server.- 指定者:
getRawStatusCode在接口中ServerHttpResponse- 覆盖:
getRawStatusCode在类中AbstractServerHttpResponse
-
applyStatusCode
protected void applyStatusCode()从类复制的说明:AbstractServerHttpResponseWrite the status code to the underlying response. This method is called once only. -
writeWithInternal
protected reactor.core.publisher.Mono<Void> writeWithInternal(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> publisher) 从类复制的说明:AbstractServerHttpResponseWrite to the underlying the response.- 指定者:
writeWithInternal在类中AbstractServerHttpResponse- 参数:
publisher- the publisher to write with
-
writeAndFlushWithInternal
protected reactor.core.publisher.Mono<Void> writeAndFlushWithInternal(org.reactivestreams.Publisher<? extends org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer>> publisher) 从类复制的说明:AbstractServerHttpResponseWrite to the underlying the response, and flush after eachPublisher<DataBuffer>.- 指定者:
writeAndFlushWithInternal在类中AbstractServerHttpResponse- 参数:
publisher- the publisher to write and flush with
-
applyHeaders
protected void applyHeaders()从类复制的说明:AbstractServerHttpResponseInvoked when the response is getting committed allowing sub-classes to make apply header values to the underlying response.Note that most sub-classes use an
HttpHeadersinstance that wraps an adapter to the native response headers such that changes are propagated to the underlying response on the go. That means this callback is typically not used other than for specialized updates such as setting the contentType or characterEncoding fields in a Servlet response.- 指定者:
applyHeaders在类中AbstractServerHttpResponse
-
applyCookies
protected void applyCookies()从类复制的说明:AbstractServerHttpResponseAdd cookies fromAbstractServerHttpResponse.getHeaders()to the underlying response. This method is called once only.- 指定者:
applyCookies在类中AbstractServerHttpResponse
-
writeWith
从接口复制的说明:ZeroCopyHttpOutputMessageUse the givenPathto write the body of the message to the underlying HTTP layer.- 指定者:
writeWith在接口中ZeroCopyHttpOutputMessage- 参数:
file- the file to transferposition- the position within the file from which the transfer is to begincount- the number of bytes to be transferred- 返回:
- a publisher that indicates completion or error.
-
toByteBuf
private org.reactivestreams.Publisher<io.netty.buffer.ByteBuf> toByteBuf(org.reactivestreams.Publisher<? extends cn.taketoday.core.io.buffer.DataBuffer> dataBuffers) -
touchDataBuffer
protected void touchDataBuffer(cn.taketoday.core.io.buffer.DataBuffer buffer) 从类复制的说明:AbstractServerHttpResponseAllow sub-classes to associate a hint with the data buffer if it is a pooled buffer and supports leak tracking.- 覆盖:
touchDataBuffer在类中AbstractServerHttpResponse- 参数:
buffer- the buffer to attach a hint to
-