public class MessageSender extends Object
Internally uses XhrConnection and/or PushConnection for
delivering messages, depending on the application configuration.
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageSender.ResynchronizationState |
| Constructor and Description |
|---|
MessageSender(Registry registry)
Creates a new instance connected to the given registry.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCommunicationMethodName()
Returns a human readable string representation of the method used to
communicate with the server.
|
void |
resynchronize()
Resynchronize the client side, i.e.
|
protected void |
send(elemental.json.JsonArray reqInvocations,
elemental.json.JsonObject extraJson)
Makes an UIDL request to the server.
|
void |
send(elemental.json.JsonObject payload)
Sends an asynchronous or synchronous UIDL request to the server using the
given URI.
|
void |
sendInvocationsToServer()
Sends any pending invocations to the server if there is no request in
progress and the application is running.
|
void |
setClientToServerMessageId(int nextExpectedId,
boolean force)
Used internally to update what id the server expects.
|
void |
setPushEnabled(boolean enabled)
Sets the status for the push connection.
|
public MessageSender(Registry registry)
registry - the global registrypublic void sendInvocationsToServer()
If a request is in progress, this method does nothing and assumes that it is called again when the request completes.
protected void send(elemental.json.JsonArray reqInvocations,
elemental.json.JsonObject extraJson)
reqInvocations - Data containing RPC invocations and all related information.extraJson - Parameters that are added to the payloadpublic void send(elemental.json.JsonObject payload)
payload - The contents of the request to sendpublic void setPushEnabled(boolean enabled)
enabled - true to enable the push connection;
false to disable the push connection.public String getCommunicationMethodName()
public void resynchronize()
public void setClientToServerMessageId(int nextExpectedId,
boolean force)
nextExpectedId - the new client id to setforce - true if the id must be updated, false otherwiseCopyright © 2000–2026 Vaadin Ltd. All rights reserved.