diff options
author | Tatu Lund <tatu@vaadin.com> | 2019-04-25 15:30:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-25 15:30:33 +0300 |
commit | e299f349c3d4788c630433d9cfb601393fe4d743 (patch) | |
tree | ba8058ebec93da2ca6ff4ed32634f00675d5f46f /server | |
parent | b8b681db376d38b24c0dcf6bd16e0335a9fc3f6e (diff) | |
download | vaadin-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.java | 23 |
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; + } } |