From 5f598586ea930a98fbe4209d25e8c667d197314e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 9 Sep 2015 11:43:52 +0200 Subject: [PATCH] SseEmitter exposes super constructor with timeout value Issue: SPR-13446 --- .../mvc/method/annotation/SseEmitter.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java index 521c8aa91c..0092e7c780 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/SseEmitter.java @@ -39,6 +39,26 @@ public class SseEmitter extends ResponseBodyEmitter { static final MediaType TEXT_PLAIN = new MediaType("text", "plain", Charset.forName("UTF-8")); + /** + * Create a new SseEmitter instance. + */ + public SseEmitter() { + super(); + } + + /** + * Create a SseEmitter with a custom timeout value. + *

By default not set in which case the default configured in the MVC + * Java Config or the MVC namespace is used, or if that's not set, then the + * timeout depends on the default of the underlying server. + * @param timeout timeout value in milliseconds + * @since 4.2.2 + */ + public SseEmitter(Long timeout) { + super(timeout); + } + + @Override protected void extendResponse(ServerHttpResponse outputMessage) { super.extendResponse(outputMessage);