Browse Source

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
tags/8.8.0
Tatu Lund 5 years ago
parent
commit
7f9a31001f

+ 23
- 0
server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java View File

@@ -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;
}
}

Loading…
Cancel
Save