Package com.vaadin.client.communication
Class ServerRpcQueue
- java.lang.Object
-
- com.vaadin.client.communication.ServerRpcQueue
-
public class ServerRpcQueue extends Object
Manages the queue of server invocations (RPC) which are waiting to be sent to the server.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description ServerRpcQueue(Registry registry)Creates a new instance connected to the given registry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(elemental.json.JsonValue invocation)Adds an explicit RPC method invocation to the send queue.voidclear()Clears the queue.voidflush()Triggers a send of server RPC and legacy variable changes to the server.booleanisEmpty()Checks if the queue is empty.booleanisFlushPending()Checks if a flush operation is pending.booleanshowLoadingIndicator()Checks if a loading indicator should be shown when the RPCs have been sent to the server and we are waiting for a response.intsize()Returns the current size of the queue.elemental.json.JsonArraytoJson()Returns the current invocations as JSON.
-
-
-
Constructor Detail
-
ServerRpcQueue
public ServerRpcQueue(Registry registry)
Creates a new instance connected to the given registry.- Parameters:
registry- the global registry
-
-
Method Detail
-
add
public void add(elemental.json.JsonValue invocation)
Adds an explicit RPC method invocation to the send queue.- Parameters:
invocation- RPC method invocation
-
clear
public void clear()
Clears the queue.
-
size
public int size()
Returns the current size of the queue.- Returns:
- the number of invocations in the queue
-
isEmpty
public boolean isEmpty()
Checks if the queue is empty.- Returns:
- true if the queue is empty, false otherwise
-
flush
public void flush()
Triggers a send of server RPC and legacy variable changes to the server.
-
isFlushPending
public boolean isFlushPending()
Checks if a flush operation is pending.- Returns:
- true if a flush is pending, false otherwise
-
showLoadingIndicator
public boolean showLoadingIndicator()
Checks if a loading indicator should be shown when the RPCs have been sent to the server and we are waiting for a response.- Returns:
- true if a loading indicator should be shown, false otherwise
-
toJson
public elemental.json.JsonArray toJson()
Returns the current invocations as JSON.- Returns:
- the current invocations in a JSON format ready to be sent to the server
-
-