Pārlūkot izejas kodu

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

Change-Id: I3569ed662bc93dd6861e40d8a4e0fa0b801551e6
tags/8.0.0.alpha1
Artur Signell pirms 7 gadiem
vecāks
revīzija
2a5671438f

+ 2
- 2
pom.xml Parādīt failu



<!-- Atmosphere versions --> <!-- Atmosphere versions -->
<!-- Note that this should be kept in sync with the class Constants --> <!-- 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 -->
<dependency.unpack.directory>${project.build.directory}/dependency-unpack</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 Parādīt failu

+ "================================================================="; + "=================================================================";


// Keep the version number in sync with pom.xml // 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" static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
+ "=================================================================\n" + "=================================================================\n"

+ 22
- 25
server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java Parādīt failu

import org.atmosphere.cpr.AtmosphereFramework.AtmosphereHandlerWrapper; import org.atmosphere.cpr.AtmosphereFramework.AtmosphereHandlerWrapper;
import org.atmosphere.cpr.AtmosphereHandler; import org.atmosphere.cpr.AtmosphereHandler;
import org.atmosphere.cpr.AtmosphereInterceptor; 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.interceptor.HeartbeatInterceptor;
import org.atmosphere.util.VoidAnnotationProcessor; import org.atmosphere.util.VoidAnnotationProcessor;


* @author Vaadin Ltd * @author Vaadin Ltd
* @since 7.1 * @since 7.1
*/ */
public class PushRequestHandler implements RequestHandler,
SessionExpiredHandler {
public class PushRequestHandler
implements RequestHandler, SessionExpiredHandler {


private AtmosphereFramework atmosphere; private AtmosphereFramework atmosphere;
private PushHandler pushHandler; private PushHandler pushHandler;
atmosphere = getPreInitializedAtmosphere(vaadinServletConfig); atmosphere = getPreInitializedAtmosphere(vaadinServletConfig);
if (atmosphere == null) { if (atmosphere == null) {
// Not initialized by JSR356WebsocketInitializer // Not initialized by JSR356WebsocketInitializer
getLogger().fine(
"Initializing Atmosphere for servlet "
+ vaadinServletConfig.getServletName());
getLogger().fine("Initializing Atmosphere for servlet "
+ vaadinServletConfig.getServletName());
try { try {
atmosphere = initAtmosphere(vaadinServletConfig); atmosphere = initAtmosphere(vaadinServletConfig);
} catch (Exception e) { } catch (Exception e) {
getLogger().log(
Level.WARNING,
getLogger().log(Level.WARNING,
"Failed to initialize Atmosphere for " "Failed to initialize Atmosphere for "
+ service.getServlet().getServletName() + service.getServlet().getServletName()
+ ". Push will not work.", e);
+ ". Push will not work.",
e);
return; return;
} }
} else { } 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 for (AtmosphereHandlerWrapper handlerWrapper : atmosphere
.getAtmosphereHandlers().values()) { .getAtmosphereHandlers().values()) {
AtmosphereHandler handler = handlerWrapper.atmosphereHandler; AtmosphereHandler handler = handlerWrapper.atmosphereHandler;
* Create your own request handler and override this method if you want to * Create your own request handler and override this method if you want to
* customize the {@link PushHandler}, e.g. to dynamically decide the suspend * customize the {@link PushHandler}, e.g. to dynamically decide the suspend
* timeout. * timeout.
*
*
* @since 7.6 * @since 7.6
* @param service * @param service
* the vaadin service * the vaadin service


/** /**
* Initializes Atmosphere for the given ServletConfiguration * Initializes Atmosphere for the given ServletConfiguration
*
*
* @since 7.5.0 * @since 7.5.0
* @param vaadinServletConfig * @param vaadinServletConfig
* The servlet configuration for the servlet which should have * The servlet configuration for the servlet which should have
return true; return true;
} }
try { try {
atmosphere.doCometSupport(AtmosphereRequest
.wrap((VaadinServletRequest) request),
AtmosphereResponse
atmosphere.doCometSupport(
AtmosphereRequestImpl
.wrap((VaadinServletRequest) request),
AtmosphereResponseImpl
.wrap((VaadinServletResponse) response)); .wrap((VaadinServletResponse) response));
} catch (ServletException e) { } catch (ServletException e) {
// TODO PUSH decide how to handle // TODO PUSH decide how to handle


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

Notiek ielāde…
Atcelt
Saglabāt