diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-12-02 06:42:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 06:42:06 +0200 |
commit | 77192020afb651756c6b35f287a29a07c07bacf9 (patch) | |
tree | 58775e0dd2d93d05fb815899ff9dceebf0630795 /server/src | |
parent | 93bba25da6005cd1b0ee50514edff5f388439b41 (diff) | |
download | vaadin-framework-77192020afb651756c6b35f287a29a07c07bacf9.tar.gz vaadin-framework-77192020afb651756c6b35f287a29a07c07bacf9.zip |
Make checkAtmosphereSupport() non-static (#12131) (#12159)
Fixes: https://github.com/vaadin/multiplatform-runtime/issues/77
Authored-by: Tatu Lund <tatu@vaadin.com>
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/main/java/com/vaadin/server/VaadinService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java index 4f01820868..31ddf7b8ba 100644 --- a/server/src/main/java/com/vaadin/server/VaadinService.java +++ b/server/src/main/java/com/vaadin/server/VaadinService.java @@ -145,7 +145,7 @@ public abstract class VaadinService implements Serializable { private Iterable<DependencyFilter> dependencyFilters; private ConnectorIdGenerator connectorIdGenerator; - private boolean atmosphereAvailable = checkAtmosphereSupport(); + private Boolean atmosphereAvailable = null; /** * Keeps track of whether a warning about missing push support has already @@ -1853,7 +1853,7 @@ public abstract class VaadinService implements Serializable { * is not available. */ public boolean ensurePushAvailable() { - if (atmosphereAvailable) { + if (isAtmosphereAvailable()) { return true; } else { if (!pushWarningEmitted) { @@ -1865,7 +1865,7 @@ public abstract class VaadinService implements Serializable { } } - private static boolean checkAtmosphereSupport() { + private boolean checkAtmosphereSupport() { String rawVersion = AtmospherePushConnection.getAtmosphereVersion(); if (rawVersion == null) { return false; @@ -1888,6 +1888,9 @@ public abstract class VaadinService implements Serializable { * @return true if Atmosphere is available, false otherwise */ protected boolean isAtmosphereAvailable() { + if (atmosphereAvailable == null) { + atmosphereAvailable = checkAtmosphereSupport(); + } return atmosphereAvailable; } |