Kaynağa Gözat

Allow overriding ServerRpcHandler creation in PushHandler (#10892)

Fixes #4537
tags/8.5.0.alpha2
lennartfricke 6 yıl önce
ebeveyn
işleme
fad7b00016

+ 13
- 1
server/src/main/java/com/vaadin/server/communication/PushHandler.java Dosyayı Görüntüle

@@ -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);
@@ -164,6 +166,16 @@ public class PushHandler {
this.service = service;
}

/**
* Creates the ServerRpcHandler to use.
*
* @return the ServerRpcHandler to use
* @since
*/
protected ServerRpcHandler createRpcHandler() {
return new ServerRpcHandler();
}

/**
* Suspends the given resource.
*

Loading…
İptal
Kaydet