Переглянути джерело

Update to latest Atmosphere (2.4.5) and JS (2.3.2)

Change-Id: I3569ed662bc93dd6861e40d8a4e0fa0b801551e6
tags/8.0.0.alpha1
Artur Signell 7 роки тому
джерело
коміт
2a5671438f

+ 2
- 2
pom.xml Переглянути файл

@@ -41,8 +41,8 @@

<!-- Atmosphere versions -->
<!-- Note that this should be kept in sync with the class Constants -->
<atmosphere.runtime.version>2.2.9.vaadin2</atmosphere.runtime.version>
<atmosphere.js.version>2.2.13.vaadin5</atmosphere.js.version>
<atmosphere.runtime.version>2.4.5.vaadin1</atmosphere.runtime.version>
<atmosphere.js.version>2.3.2.vaadin1</atmosphere.js.version>

<!-- Dependency unpack directory -->
<dependency.unpack.directory>${project.build.directory}/dependency-unpack</dependency.unpack.directory>

+ 1
- 1
server/src/main/java/com/vaadin/server/Constants.java Переглянути файл

@@ -67,7 +67,7 @@ public interface Constants {
+ "=================================================================";

// Keep the version number in sync with pom.xml
static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.9.vaadin2";
static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.4.5.vaadin1";

static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
+ "=================================================================\n"

+ 22
- 25
server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java Переглянути файл

@@ -30,8 +30,8 @@ import org.atmosphere.cpr.AtmosphereFramework;
import org.atmosphere.cpr.AtmosphereFramework.AtmosphereHandlerWrapper;
import org.atmosphere.cpr.AtmosphereHandler;
import org.atmosphere.cpr.AtmosphereInterceptor;
import org.atmosphere.cpr.AtmosphereRequest;
import org.atmosphere.cpr.AtmosphereResponse;
import org.atmosphere.cpr.AtmosphereRequestImpl;
import org.atmosphere.cpr.AtmosphereResponseImpl;
import org.atmosphere.interceptor.HeartbeatInterceptor;
import org.atmosphere.util.VoidAnnotationProcessor;

@@ -58,8 +58,8 @@ import com.vaadin.shared.communication.PushConstants;
* @author Vaadin Ltd
* @since 7.1
*/
public class PushRequestHandler implements RequestHandler,
SessionExpiredHandler {
public class PushRequestHandler
implements RequestHandler, SessionExpiredHandler {

private AtmosphereFramework atmosphere;
private PushHandler pushHandler;
@@ -82,30 +82,26 @@ public class PushRequestHandler implements RequestHandler,
atmosphere = getPreInitializedAtmosphere(vaadinServletConfig);
if (atmosphere == null) {
// Not initialized by JSR356WebsocketInitializer
getLogger().fine(
"Initializing Atmosphere for servlet "
+ vaadinServletConfig.getServletName());
getLogger().fine("Initializing Atmosphere for servlet "
+ vaadinServletConfig.getServletName());
try {
atmosphere = initAtmosphere(vaadinServletConfig);
} catch (Exception e) {
getLogger().log(
Level.WARNING,
getLogger().log(Level.WARNING,
"Failed to initialize Atmosphere for "
+ service.getServlet().getServletName()
+ ". Push will not work.", e);
+ ". Push will not work.",
e);
return;
}
} else {
getLogger().fine(
"Using pre-initialized Atmosphere for servlet "
+ vaadinServletConfig.getServletName());
getLogger().fine("Using pre-initialized Atmosphere for servlet "
+ vaadinServletConfig.getServletName());
}
pushHandler
.setLongPollingSuspendTimeout(atmosphere
.getAtmosphereConfig()
.getInitParameter(
com.vaadin.server.Constants.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING,
-1));
pushHandler.setLongPollingSuspendTimeout(
atmosphere.getAtmosphereConfig().getInitParameter(
com.vaadin.server.Constants.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING,
-1));
for (AtmosphereHandlerWrapper handlerWrapper : atmosphere
.getAtmosphereHandlers().values()) {
AtmosphereHandler handler = handlerWrapper.atmosphereHandler;
@@ -124,7 +120,7 @@ public class PushRequestHandler implements RequestHandler,
* Create your own request handler and override this method if you want to
* customize the {@link PushHandler}, e.g. to dynamically decide the suspend
* timeout.
*
*
* @since 7.6
* @param service
* the vaadin service
@@ -158,7 +154,7 @@ public class PushRequestHandler implements RequestHandler,

/**
* Initializes Atmosphere for the given ServletConfiguration
*
*
* @since 7.5.0
* @param vaadinServletConfig
* The servlet configuration for the servlet which should have
@@ -244,9 +240,10 @@ public class PushRequestHandler implements RequestHandler,
return true;
}
try {
atmosphere.doCometSupport(AtmosphereRequest
.wrap((VaadinServletRequest) request),
AtmosphereResponse
atmosphere.doCometSupport(
AtmosphereRequestImpl
.wrap((VaadinServletRequest) request),
AtmosphereResponseImpl
.wrap((VaadinServletResponse) response));
} catch (ServletException e) {
// TODO PUSH decide how to handle
@@ -266,7 +263,7 @@ public class PushRequestHandler implements RequestHandler,

/*
* (non-Javadoc)
*
*
* @see
* com.vaadin.server.SessionExpiredHandler#handleSessionExpired(com.vaadin
* .server.VaadinRequest, com.vaadin.server.VaadinResponse)

Завантаження…
Відмінити
Зберегти