import com.vaadin.annotations.Viewport;
import com.vaadin.annotations.ViewportGeneratorClass;
+import com.vaadin.server.communication.AtmospherePushConnection;
import com.vaadin.shared.ApplicationConstants;
import com.vaadin.shared.Version;
import com.vaadin.shared.communication.PushMode;
JsonObject versionInfo = Json.createObject();
versionInfo.put("vaadinVersion", Version.getFullVersion());
- versionInfo.put("atmosphereVersion",
- org.atmosphere.util.Version.getRawVersion());
+ String atmosphereVersion = AtmospherePushConnection
+ .getAtmosphereVersion();
+ if (atmosphereVersion != null) {
+ versionInfo.put("atmosphereVersion", atmosphereVersion);
+ }
+
appConfig.put("versionInfo", versionInfo);
appConfig.put("widgetset", context.getWidgetsetName());
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
-import org.atmosphere.util.Version;
-
+import com.vaadin.server.communication.AtmospherePushConnection;
import com.vaadin.server.communication.PushRequestHandler;
import com.vaadin.server.communication.ServletBootstrapHandler;
import com.vaadin.server.communication.ServletUIInitHandler;
}
private static boolean checkAtmosphereSupport() {
- try {
- String rawVersion = Version.getRawVersion();
- if (!Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION
- .equals(rawVersion)) {
- getLogger().log(
- Level.WARNING,
- Constants.INVALID_ATMOSPHERE_VERSION_WARNING,
- new Object[] {
- Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION,
- rawVersion });
- }
- return true;
- } catch (NoClassDefFoundError e) {
+ String rawVersion = AtmospherePushConnection.getAtmosphereVersion();
+ if (rawVersion == null) {
return false;
}
+
+ if (!Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION.equals(rawVersion)) {
+ getLogger().log(
+ Level.WARNING,
+ Constants.INVALID_ATMOSPHERE_VERSION_WARNING,
+ new Object[] {
+ Constants.REQUIRED_ATMOSPHERE_RUNTIME_VERSION,
+ rawVersion });
+ }
+ return true;
}
@Override
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.AtmosphereResource.TRANSPORT;
+import org.atmosphere.util.Version;
import com.vaadin.shared.communication.PushConstants;
import com.vaadin.ui.UI;
*/
public class AtmospherePushConnection implements PushConnection {
+ public static String getAtmosphereVersion() {
+ try {
+ String v = Version.getRawVersion();
+ assert v != null;
+ return v;
+ } catch (NoClassDefFoundError e) {
+ return null;
+ }
+ }
+
/**
* Represents a message that can arrive as multiple fragments.
*/