summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorlennartfricke <30312169+lennartfricke@users.noreply.github.com>2018-05-09 16:52:55 +0200
committerIlia Motornyi <elmot@vaadin.com>2018-05-09 17:52:55 +0300
commitfad7b00016bf5308548b55c080fc272355a0f835 (patch)
tree60c006fc4264ac4ce28c2f9dca0337b40a5f327e /server
parent1b9feecc7400756dcec4f8bb7673a5487ce9bbb2 (diff)
downloadvaadin-framework-fad7b00016bf5308548b55c080fc272355a0f835.tar.gz
vaadin-framework-fad7b00016bf5308548b55c080fc272355a0f835.zip
Allow overriding ServerRpcHandler creation in PushHandler (#10892)
Fixes #4537
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PushHandler.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/server/communication/PushHandler.java b/server/src/main/java/com/vaadin/server/communication/PushHandler.java
index 33c2041f8c..0613d883f2 100644
--- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java
+++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java
@@ -58,6 +58,8 @@ public class PushHandler {
private int longPollingSuspendTimeout = -1;
+ private final ServerRpcHandler rpcHandler = createRpcHandler();
+
/**
* Callback interface used internally to process an event with the
* corresponding UI properly locked.
@@ -143,7 +145,7 @@ public class PushHandler {
assert vaadinRequest != null;
try {
- new ServerRpcHandler().handleRpc(ui, reader, vaadinRequest);
+ rpcHandler.handleRpc(ui, reader, vaadinRequest);
connection.push(false);
} catch (JsonException e) {
getLogger().log(Level.SEVERE, "Error writing JSON to response", e);
@@ -165,6 +167,16 @@ public class PushHandler {
}
/**
+ * Creates the ServerRpcHandler to use.
+ *
+ * @return the ServerRpcHandler to use
+ * @since
+ */
+ protected ServerRpcHandler createRpcHandler() {
+ return new ServerRpcHandler();
+ }
+
+ /**
* Suspends the given resource.
*
* @since 7.6