ResponseBodyEmitter and subclasses
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.
| Modifier and Type | Class and Description |
|---|---|
| private class | ResponseBodyEmitterReturnValueHandler.
ResponseBodyEmitter.Handler that writes with HttpMessageConverter's. |
| private static class | ResponseBodyEmitterReturnValueHandler.
Wrap to silently ignore header changes HttpMessageConverter's that would otherwise cause HttpHeaders to raise exceptions. |
| Modifier and Type | Field and Description |
|---|---|
| private final ReactiveTypeHandler | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | ResponseBodyEmitterReturnValueHandler(List<HttpMessageConverter<?>> messageConverters)
Simple constructor with reactive type support based on a default instance of
|
| public | ResponseBodyEmitterReturnValueHandler(List<HttpMessageConverter<?>>
converters to write emitted objects with messageConverters, ReactiveAdapterRegistry for reactive return value type support registry, TaskExecutor for blocking I/O writes of items emitted from reactive types executor, ContentNegotiationManager for detecting streaming media types manager)Complete constructor with pluggable "reactive" type support. |
| Modifier and Type | Method and Description |
|---|---|
| public void | handleReturnValue(Object
the value returned from the handler method returnValue, MethodParameter the type of the return value. This type must have
previously been passed to returnType, ModelAndViewContainer supportsReturnType which must
have returned true.the ModelAndViewContainer for the current request mavContainer, NativeWebRequest the current request webRequest)Implements org. Handle the given return value by adding attributes to the model and
setting a view or setting the
|
| private static List | |
| public boolean | supportsReturnType(MethodParameter
the method return type to check returnType)Implements org. Whether the given method return type is supported by this handler. |
| reactiveHandler | back to summary |
|---|---|
| private final ReactiveTypeHandler reactiveHandler | |
| sseMessageConverters | back to summary |
|---|---|
| private final List<HttpMessageConverter<?>> sseMessageConverters | |
| ResponseBodyEmitterReturnValueHandler | back to summary |
|---|---|
| public ResponseBodyEmitterReturnValueHandler(List<HttpMessageConverter<?>> messageConverters) Simple constructor with reactive type support based on a default instance of
| |
| ResponseBodyEmitterReturnValueHandler | back to summary |
|---|---|
| public ResponseBodyEmitterReturnValueHandler(List<HttpMessageConverter<?>> messageConverters, ReactiveAdapterRegistry registry, TaskExecutor executor, ContentNegotiationManager manager) Complete constructor with pluggable "reactive" type support.
| |
| handleReturnValue | back to summary |
|---|---|
| public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception Implements org. Doc from org. Handle the given return value by adding attributes to the model and
setting a view or setting the
| |
| initSseConverters | back to summary |
|---|---|
| private static List | |
| supportsReturnType | back to summary |
|---|---|
| public boolean supportsReturnType(MethodParameter returnType) Implements org. Doc from org. Whether the given method return type is supported by this handler.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final DeferredResult | |
| private final ServerHttpResponse |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | send(Object data, MediaType mediaType)
Implements org. Immediately write and flush the given data to the network. |
| public void | send(Set<ResponseBodyEmitter.
Implements org. Immediately write all data items then flush to the network. |
| private <T> void |
| deferredResult | back to summary |
|---|---|
| private final DeferredResult<?> deferredResult | |
| outputMessage | back to summary |
|---|---|
| private final ServerHttpResponse outputMessage | |
| HttpMessageConvertingHandler | back to summary |
|---|---|
| public HttpMessageConvertingHandler(ServerHttpResponse outputMessage, DeferredResult<?> deferredResult) | |
| complete | back to summary |
|---|---|
| public void complete() Implements org.
| |
| completeWithError | back to summary |
|---|---|
| public void completeWithError(Throwable failure) Implements org.
| |
| onCompletion | back to summary |
|---|---|
| public void onCompletion(Runnable callback) Implements org.
| |
| onError | back to summary |
|---|---|
| public void onError(Consumer<Throwable> callback) Implements org.
| |
| onTimeout | back to summary |
|---|---|
| public void onTimeout(Runnable callback) Implements org.
| |
| send | back to summary |
|---|---|
| public void send(Object data, MediaType mediaType) throws IOException Implements org. Doc from org. Immediately write and flush the given data to the network.
| |
| send | back to summary |
|---|---|
| public void send(Set<ResponseBodyEmitter. Implements org. Doc from org. Immediately write all data items then flush to the network.
| |
| sendInternal | back to summary |
|---|---|
private <T> void sendInternal(T data, MediaType mediaType) throws IOException
| |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpHeaders |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HttpHeaders | getHeaders()
Overrides org. Implements org. Return the headers of this message. |
| mutableHeaders | back to summary |
|---|---|
| private final HttpHeaders mutableHeaders | |
| StreamingServletServerHttpResponse | back to summary |
|---|---|
| public StreamingServletServerHttpResponse(ServerHttpResponse delegate) | |
| getHeaders | back to summary |
|---|---|
| public HttpHeaders getHeaders() Overrides org. Implements org. Doc from org. Return the headers of this message.
| |