summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-07-19 14:36:56 +0300
committerLeif Åstrand <leif@vaadin.com>2013-07-19 14:36:56 +0300
commit9c8eb70dd54c1ba56d02111b9246a7767e1a0442 (patch)
tree21f6731d7617da57c7ac02757c3ba7fe9450fc03 /server
parent7f5a0a7827570188b7c62ed362f4724886b1a94d (diff)
downloadvaadin-framework-9c8eb70dd54c1ba56d02111b9246a7767e1a0442.tar.gz
vaadin-framework-9c8eb70dd54c1ba56d02111b9246a7767e1a0442.zip
Close PushRequestHandler when VaadinServlet is destroyed (#11878)
Should be implemented using ServiceDestoryListener in Vaadin 7.2 Merge: no Change-Id: Ibb4d37f1f95c56b80111df3a3217076af18dd93d
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/VaadinServlet.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java
index 803a903341..c16be33de2 100644
--- a/server/src/com/vaadin/server/VaadinServlet.java
+++ b/server/src/com/vaadin/server/VaadinServlet.java
@@ -43,6 +43,7 @@ import javax.servlet.http.HttpServletResponse;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.annotations.VaadinServletConfiguration.InitParameterName;
import com.vaadin.sass.internal.ScssStylesheet;
+import com.vaadin.server.communication.PushRequestHandler;
import com.vaadin.server.communication.ServletUIInitHandler;
import com.vaadin.shared.JsonConstants;
import com.vaadin.ui.UI;
@@ -1076,6 +1077,17 @@ public class VaadinServlet extends HttpServlet implements Constants {
return u;
}
+ @Override
+ public void destroy() {
+ super.destroy();
+
+ for (RequestHandler handler : getService().getRequestHandlers()) {
+ if (handler instanceof PushRequestHandler) {
+ ((PushRequestHandler) handler).destroy();
+ }
+ }
+ }
+
/**
* Escapes characters to html entities. An exception is made for some
* "safe characters" to keep the text somewhat readable.