Browse Source

Make checkAtmosphereSupport() non-static (#12131)

Fixes: https://github.com/vaadin/multiplatform-runtime/issues/77
tags/7.7.23
Tatu Lund 3 years ago
parent
commit
00159ed3d2
No account linked to committer's email address
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      server/src/main/java/com/vaadin/server/VaadinService.java

+ 6
- 3
server/src/main/java/com/vaadin/server/VaadinService.java View File

private Iterable<DependencyFilter> dependencyFilters; private Iterable<DependencyFilter> dependencyFilters;
private ConnectorIdGenerator connectorIdGenerator; private ConnectorIdGenerator connectorIdGenerator;


private boolean atmosphereAvailable = checkAtmosphereSupport();
private Boolean atmosphereAvailable = null;


/** /**
* Keeps track of whether a warning about missing push support has already * Keeps track of whether a warning about missing push support has already
* is not available. * is not available.
*/ */
public boolean ensurePushAvailable() { public boolean ensurePushAvailable() {
if (atmosphereAvailable) {
if (isAtmosphereAvailable()) {
return true; return true;
} else { } else {
if (!pushWarningEmitted) { if (!pushWarningEmitted) {
} }
} }


private static boolean checkAtmosphereSupport() {
private boolean checkAtmosphereSupport() {
String rawVersion = AtmospherePushConnection.getAtmosphereVersion(); String rawVersion = AtmospherePushConnection.getAtmosphereVersion();
if (rawVersion == null) { if (rawVersion == null) {
return false; return false;
* @return true if Atmosphere is available, false otherwise * @return true if Atmosphere is available, false otherwise
*/ */
protected boolean isAtmosphereAvailable() { protected boolean isAtmosphereAvailable() {
if (atmosphereAvailable == null) {
atmosphereAvailable = checkAtmosphereSupport();
}
return atmosphereAvailable; return atmosphereAvailable;
} }



Loading…
Cancel
Save