public class ServerRpcHandler extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ServerRpcHandler.InvalidUIDLSecurityKeyException
Exception thrown then the security key sent by the client does not match
the expected one.
|
static class |
ServerRpcHandler.ResynchronizationRequiredException
Exception thrown then the client side resynchronization is required.
|
static class |
ServerRpcHandler.RpcRequest
A data transfer object representing an RPC request sent by the client
side.
|
Constructor and Description |
---|
ServerRpcHandler() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,RpcInvocationHandler> |
getInvocationHandlers()
Gets
RpcInvocationHandler s map where the key is the type of the
handler gotten via RpcInvocationHandler.getRpcType() . |
protected String |
getMessage(Reader reader) |
void |
handleRpc(UI ui,
Reader reader,
VaadinRequest request)
Reads JSON containing zero or more serialized RPC calls (including legacy
variable changes) and executes the calls.
|
public void handleRpc(UI ui, Reader reader, VaadinRequest request) throws IOException, ServerRpcHandler.InvalidUIDLSecurityKeyException
ui
- The UI
receiving the calls. Cannot be null.reader
- The Reader
used to read the JSON.request
- The request through which the RPC was receivedIOException
- If reading the message fails.ServerRpcHandler.InvalidUIDLSecurityKeyException
- If the received security key does not match the one stored in
the session.protected Map<String,RpcInvocationHandler> getInvocationHandlers()
RpcInvocationHandler
s map where the key is the type of the
handler gotten via RpcInvocationHandler.getRpcType()
.
This map is used to delegate RPC requests to a specific invocation handler using the type of the request.
Subclasses can overwrite this method to return custom invocation handlers.
protected String getMessage(Reader reader) throws IOException
IOException
Copyright © 2020. All rights reserved.