summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
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;
+ }
}