summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2019-04-25 15:30:33 +0300
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>2019-04-29 14:29:30 +0300
commit7f9a31001f175c1b55199b98d0e3aa0df1be6c6c (patch)
treec98c9cc447d15bb190256a3621e3bf96eb58ad54
parent4cd47cae35dec16b2f3b7e57a0ba6d126ab64c07 (diff)
downloadvaadin-framework-7f9a31001f175c1b55199b98d0e3aa0df1be6c6c.tar.gz
vaadin-framework-7f9a31001f175c1b55199b98d0e3aa0df1be6c6c.zip
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
-rw-r--r--server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java23
1 files changed, 23 insertions, 0 deletions
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.
+ * <p>
+ * 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 <code>true</code> if Atmosphere is available, <code>false</code>
+ * otherwise
+ */
+ public static boolean isAtmosphereAvailable() {
+ return atmosphereAvailable;
+ }
}