ソースを参照

Allow overriding ServerRpcHandler creation in PushHandler (#10892)

Fixes #4537
tags/8.5.0.alpha2
lennartfricke 6年前
コミット
fad7b00016

+ 13
- 1
server/src/main/java/com/vaadin/server/communication/PushHandler.java ファイルの表示



private int longPollingSuspendTimeout = -1; private int longPollingSuspendTimeout = -1;


private final ServerRpcHandler rpcHandler = createRpcHandler();

/** /**
* Callback interface used internally to process an event with the * Callback interface used internally to process an event with the
* corresponding UI properly locked. * corresponding UI properly locked.
assert vaadinRequest != null; assert vaadinRequest != null;


try { try {
new ServerRpcHandler().handleRpc(ui, reader, vaadinRequest);
rpcHandler.handleRpc(ui, reader, vaadinRequest);
connection.push(false); connection.push(false);
} catch (JsonException e) { } catch (JsonException e) {
getLogger().log(Level.SEVERE, "Error writing JSON to response", e); getLogger().log(Level.SEVERE, "Error writing JSON to response", e);
this.service = service; this.service = service;
} }


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

/** /**
* Suspends the given resource. * Suspends the given resource.
* *

読み込み中…
キャンセル
保存