summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2013-12-16 13:56:19 +0200
committerJohannes Dahlström <johannesd@vaadin.com>2013-12-18 08:29:54 +0000
commit797ebdff7c1cb5c0d58910f3ff6e86bbdb91ea0a (patch)
tree55fe1b36c909d8189fda5a83b4058697bdb81ebb
parentea8f381d440b3d5d3d7785b7b235155263aaab2a (diff)
downloadvaadin-framework-797ebdff7c1cb5c0d58910f3ff6e86bbdb91ea0a.tar.gz
vaadin-framework-797ebdff7c1cb5c0d58910f3ff6e86bbdb91ea0a.zip
Allow user to override Atmosphere init params set by Vaadin (#13088)
Change-Id: Iea7c7978240f79cb7c9586b472e94da53d625ba7
-rw-r--r--server/src/com/vaadin/server/communication/PushRequestHandler.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/server/src/com/vaadin/server/communication/PushRequestHandler.java b/server/src/com/vaadin/server/communication/PushRequestHandler.java
index 8d0da24896..aff07d96d7 100644
--- a/server/src/com/vaadin/server/communication/PushRequestHandler.java
+++ b/server/src/com/vaadin/server/communication/PushRequestHandler.java
@@ -18,6 +18,7 @@ package com.vaadin.server.communication;
import java.io.IOException;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import org.atmosphere.client.TrackMessageSizeInterceptor;
@@ -56,11 +57,22 @@ public class PushRequestHandler implements RequestHandler,
public PushRequestHandler(VaadinServletService service)
throws ServiceException {
+ final ServletConfig config = service.getServlet().getServletConfig();
+
atmosphere = new AtmosphereFramework() {
@Override
protected void analytics() {
// Overridden to disable version number check
}
+
+ @Override
+ public AtmosphereFramework addInitParameter(String name,
+ String value) {
+ if (config.getInitParameter(name) == null) {
+ super.addInitParameter(name, value);
+ }
+ return this;
+ }
};
pushHandler = new PushHandler(service);
@@ -84,7 +96,7 @@ public class PushRequestHandler implements RequestHandler,
"false");
try {
- atmosphere.init(service.getServlet().getServletConfig());
+ atmosphere.init(config);
// Ensure the client-side knows how to split the message stream
// into individual messages when using certain transports