summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorKnoobie <Knoobie@gmx.de>2019-12-03 15:20:19 +0100
committerAnna Koskinen <Ansku@users.noreply.github.com>2019-12-03 16:20:19 +0200
commit1be20818a6db9c6d1a33e12d183421ffa054467e (patch)
treecb7cb50a2cbc0c4f4858b966ba3bd8d33e5a4c7d /server
parent4dc4f83865d72fc3d56a96a4a01db1a36e959908 (diff)
downloadvaadin-framework-1be20818a6db9c6d1a33e12d183421ffa054467e.tar.gz
vaadin-framework-1be20818a6db9c6d1a33e12d183421ffa054467e.zip
Make VaadinService.cleanupSession public (#11738)
to allow for better integration of third party applications handling the destruction of the session. Usage example (see https://vaadin.com/directory/component/cleanupservlet-add-on/overview) "It's possible to close a browser window in such way that neither UI cleanup nor session cleanup will happen until the underlying http session timeouts. This can happen because the design idea for heartbeat is to keep the UI alive, not to ensure timely cleanup, and as such the default check is only performed at the end of each request."
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinService.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java
index 9503db113f..f83441e1c3 100644
--- a/server/src/main/java/com/vaadin/server/VaadinService.java
+++ b/server/src/main/java/com/vaadin/server/VaadinService.java
@@ -1226,13 +1226,14 @@ public abstract class VaadinService implements Serializable {
}
/**
- * Called at the end of a request, after sending the response. Closes
- * inactive UIs in the given session, removes closed UIs from the session,
- * and closes the session if it is itself inactive.
+ * Closes inactive UIs in the given session, removes closed UIs from the
+ * session, and closes the session if it is itself inactive. This operation
+ * should not be performed without first acquiring the session lock. By
+ * default called at the end of each request, after sending the response.
*
* @param session
*/
- void cleanupSession(VaadinSession session) {
+ public void cleanupSession(VaadinSession session) {
if (isSessionActive(session)) {
closeInactiveUIs(session);
removeClosedUIs(session);