]> source.dussan.org Git - vaadin-framework.git/commitdiff
Update to Atmosphere 2.2 (#14534)
authorArtur Signell <artur@vaadin.com>
Thu, 18 Dec 2014 07:12:43 +0000 (09:12 +0200)
committerVaadin Code Review <review@vaadin.com>
Thu, 18 Dec 2014 08:20:42 +0000 (08:20 +0000)
Does not use the new heartbeat mechanism in Atmosphere 2.2 because the heartbeat
mechanism will cause the client to reconnect every 60 seconds when idle.
It does not currently work with Vaadin because no onreopen event is fired by
Atmosphere (https://github.com/Atmosphere/atmosphere-javascript/issues/141) and thus
Vaadin will wait forever for Atmosphere to indicate that the connection is available
again after the disconnect.

Change-Id: I3a61b2c5d611f09c3092f817834e6382e1ca9894

push/build.xml
push/ivy.xml
server/src/com/vaadin/server/Constants.java
server/src/com/vaadin/server/communication/PushRequestHandler.java
uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java

index 0a106f5023513f3c86c6e83942d442fee7a38756..b7d57cf4d3dd7ce7ab84122671ab2383a6fc30f1 100644 (file)
@@ -16,7 +16,7 @@
     <property name="vaadinPush.debug.js" location="${result.dir}/js/VAADIN/vaadinPush.debug.js" />
 
     <!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java -->
-    <property name="atmosphere.runtime.version" value="2.1.2.vaadin6" />
+    <property name="atmosphere.runtime.version" value="2.2.4.vaadin2" />
     <property name="jquery.js" location="lib/jquery/jquery-1.11.0.js" />
 
     <path id="classpath.compile.custom" />
index fef53b4c9be85b8f3d8de6203cb07304ccc584e3..b899b34af7dbcad46216370fbb648b095b09813b 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE ivy-module [
 <!-- Keep the version number in sync with build.xml -->
-    <!ENTITY atmosphere.runtime.version "2.1.2.vaadin6">
+    <!ENTITY atmosphere.runtime.version "2.2.4.vaadin2">
 
-    <!ENTITY atmosphere.js.version "2.1.5.vaadin4">
+    <!ENTITY atmosphere.js.version "2.2.6.vaadin3">
 ]>
 <ivy-module version="2.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
index 5841bfac4de9e29743b6786b21bd01f4d5b81c17..02a992a88233f9e462531cc6d33dfd85230f3b61 100644 (file)
@@ -67,7 +67,7 @@ public interface Constants {
 
     // Keep the version number in sync with push/build.xml and other locations
     // listed in that file
-    static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.1.2.vaadin6";
+    static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.4.vaadin2";
 
     static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
             + "=================================================================\n"
index 308f94686f22852fead0a936ef11bcd71c509e65..b1a8ea25a7e5807bf3f7cc5f12497cd03283ba1e 100644 (file)
@@ -28,6 +28,7 @@ import org.atmosphere.cpr.AtmosphereFramework;
 import org.atmosphere.cpr.AtmosphereInterceptor;
 import org.atmosphere.cpr.AtmosphereRequest;
 import org.atmosphere.cpr.AtmosphereResponse;
+import org.atmosphere.interceptor.HeartbeatInterceptor;
 
 import com.vaadin.server.RequestHandler;
 import com.vaadin.server.ServiceDestroyEvent;
@@ -102,6 +103,12 @@ public class PushRequestHandler implements RequestHandler,
             atmosphere.addInitParameter(ApplicationConfig.MESSAGE_DELIMITER,
                     String.valueOf(PushConstants.MESSAGE_DELIMITER));
 
+            // Disable heartbeat (it does not emit correct events client side)
+            // https://github.com/Atmosphere/atmosphere-javascript/issues/141
+            atmosphere.addInitParameter(
+                    ApplicationConfig.DISABLE_ATMOSPHEREINTERCEPTORS,
+                    HeartbeatInterceptor.class.getName());
+
             final String bufferSize = String
                     .valueOf(PushConstants.WEBSOCKET_BUFFER_SIZE);
             atmosphere.addInitParameter(
index e7a74775bf75b9a921eeca55bc6908c2529c75e9..182a2e67e47e6dc8d4d93b6a061448f57c0e1e29 100644 (file)
@@ -30,6 +30,7 @@ import com.vaadin.server.VaadinService;
 import com.vaadin.server.VaadinServletService;
 import com.vaadin.tests.components.AbstractTestUIWithLog;
 import com.vaadin.ui.JavaScriptFunction;
+
 import elemental.json.JsonArray;
 
 // Load vaadinPush.js so that jQueryVaadin is defined 
@@ -39,7 +40,7 @@ public class TrackMessageSizeUI extends AbstractTestUIWithLog {
     private String testMethod = "function testSequence(expected, data) {\n"
             + "    var request = {trackMessageLength: true, messageDelimiter: '|'};\n"
             + "    _request = {trackMessageLength: true, messageDelimiter: '|'};\n"
-            + "    _handleProtocol = function(a,b) {return true;};"
+            + "    _handleProtocol = function(a,message) {return message;};"
             + "    var response = {partialMessage: ''};\n"
             + "    var messages = [];\n"
             + "    for(var i = 0; i < data.length; i++) {\n"