public class ResponseBodyEmitterReturnValueHandler
extends java.lang.Object
implements org.springframework.web.method.support.HandlerMethodReturnValueHandler
ResponseBodyEmitter
and sub-classes
such as SseEmitter
including the same types wrapped with
ResponseEntity
.
As of 5.0 also supports reactive return value types for any reactive
library with registered adapters in ReactiveAdapterRegistry
.
Constructor and Description |
---|
ResponseBodyEmitterReturnValueHandler(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)
Simple constructor with reactive type support based on a default instance of
ReactiveAdapterRegistry ,
SyncTaskExecutor , and
ContentNegotiationManager with an Accept header strategy. |
ResponseBodyEmitterReturnValueHandler(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters,
org.springframework.core.ReactiveAdapterRegistry reactiveRegistry,
org.springframework.core.task.TaskExecutor executor,
org.springframework.web.accept.ContentNegotiationManager manager)
Complete constructor with pluggable "reactive" type support.
|
Modifier and Type | Method and Description |
---|---|
void |
handleReturnValue(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.web.method.support.ModelAndViewContainer mavContainer,
org.springframework.web.context.request.NativeWebRequest webRequest) |
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType) |
public ResponseBodyEmitterReturnValueHandler(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters)
ReactiveAdapterRegistry
,
SyncTaskExecutor
, and
ContentNegotiationManager
with an Accept header strategy.public ResponseBodyEmitterReturnValueHandler(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> messageConverters, org.springframework.core.ReactiveAdapterRegistry reactiveRegistry, org.springframework.core.task.TaskExecutor executor, org.springframework.web.accept.ContentNegotiationManager manager)
messageConverters
- converters to write emitted objects withreactiveRegistry
- for reactive return value type supportexecutor
- for blocking I/O writes of items emitted from reactive typesmanager
- for detecting streaming media typespublic boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
supportsReturnType
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
public void handleReturnValue(@Nullable java.lang.Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest webRequest) throws java.lang.Exception
handleReturnValue
in interface org.springframework.web.method.support.HandlerMethodReturnValueHandler
java.lang.Exception