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
    Creates a new instance connected to the given registry.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(elemental.json.JsonValue invocation)
    Adds an explicit RPC method invocation to the send queue.
    void
    Clears the queue.
    void
    Triggers a send of server RPC and legacy variable changes to the server.
    boolean
    Checks if the queue is empty.
    boolean
    Checks if a flush operation is pending.
    boolean
    Checks if a loading indicator should be shown when the RPCs have been sent to the server and we are waiting for a response.
    int
    Returns the current size of the queue.
    elemental.json.JsonArray
    Returns the current invocations as JSON.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServerRpcQueue

      public ServerRpcQueue(Registry registry)
      Creates a new instance connected to the given registry.
      Parameters:
      registry - the global registry
  • Method Details

    • 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