From 7f9a31001f175c1b55199b98d0e3aa0df1be6c6c Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Thu, 25 Apr 2019 15:30:33 +0300 Subject: Opening methods for Spring add-on to be used in the fix (#11551) Spring add-on needs to use these added methods in order to fix #10922 --- .../communication/JSR356WebsocketInitializer.java | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java b/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java index eb39292a8c..39f0b3df97 100644 --- a/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java +++ b/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java @@ -104,6 +104,20 @@ public class JSR356WebsocketInitializer implements ServletContextListener { return; } + init(servletContext); + } + + /** + * Initializes Atmosphere for use with Vaadin servlets found in the given + * context. + *

+ * For JSR 356 websockets to work properly, the initialization must be done + * in the servlet context initialization phase. + * + * @param servletContext + * The servlet context + */ + public void init(ServletContext servletContext) { if (!atmosphereAvailable) { return; } @@ -239,4 +253,13 @@ public class JSR356WebsocketInitializer implements ServletContextListener { } } + /** + * Checks if Atmosphere is available on the classpath. + * + * @return true if Atmosphere is available, false + * otherwise + */ + public static boolean isAtmosphereAvailable() { + return atmosphereAvailable; + } } -- cgit v1.2.3