summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTatu Lund <tatu@vaadin.com>2019-04-25 15:30:33 +0300
committerGitHub <noreply@github.com>2019-04-25 15:30:33 +0300
commite299f349c3d4788c630433d9cfb601393fe4d743 (patch)
treeba8058ebec93da2ca6ff4ed32634f00675d5f46f /server
parentb8b681db376d38b24c0dcf6bd16e0335a9fc3f6e (diff)
downloadvaadin-framework-e299f349c3d4788c630433d9cfb601393fe4d743.tar.gz
vaadin-framework-e299f349c3d4788c630433d9cfb601393fe4d743.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
Diffstat (limited to 'server')
-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;
+ }
}