Interface RemoteObject


public interface RemoteObject
Instances of this interface represent an object on the client that is synchronized with an object on the server. A RemoteObject is used to transfer changes to the remote object. To create a remote object, use Connection.createRemoteObject(String).
Since:
2.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    call(String method, JsonObject parameters)
    Calls the method with the given name on the remote object.
    void
    Instructs the client to destroy the remote object.
    Returns the id that is used to synchronize this object with the client.
    void
    listen(String eventType, boolean listen)
    Instructs the remote object to listen or to stop listening on the given type of events.
    void
    set(String name, boolean value)
    Sets the specified property of the remote object to the given value.
    void
    set(String name, double value)
    Sets the specified property of the remote object to the given value.
    void
    set(String name, int value)
    Sets the specified property of the remote object to the given value.
    void
    set(String name, String value)
    Sets the specified property of the remote object to the given value.
    void
    set(String name, JsonValue value)
    Sets the specified property of the remote object to the given value.
    void
    Set a handler to process incoming operations from the remote object.
  • Method Details

    • getId

      String getId()
      Returns the id that is used to synchronize this object with the client. This id is created by the framework and does not change over the lifetime of the object.
      Since:
      2.1
    • set

      void set(String name, int value)
      Sets the specified property of the remote object to the given value.
      Parameters:
      name - the name of the property to set
      value - the value to set
    • set

      void set(String name, double value)
      Sets the specified property of the remote object to the given value.
      Parameters:
      name - the name of the property to set
      value - the value to set
    • set

      void set(String name, boolean value)
      Sets the specified property of the remote object to the given value.
      Parameters:
      name - the name of the property to set
      value - the value to set
    • set

      void set(String name, String value)
      Sets the specified property of the remote object to the given value.
      Parameters:
      name - the name of the property to set
      value - the value to set
    • set

      void set(String name, JsonValue value)
      Sets the specified property of the remote object to the given value.
      Parameters:
      name - the name of the property to set
      value - the value to set, must not be null
      Since:
      2.1
    • listen

      void listen(String eventType, boolean listen)
      Instructs the remote object to listen or to stop listening on the given type of events. When the client is listening, it must notify the server when an event of the given type occurs.
      Parameters:
      eventType - the name of event type to listen
      listen - true to listen to this type of events, false otherwise
    • call

      void call(String method, JsonObject parameters)
      Calls the method with the given name on the remote object.
      Parameters:
      method - the name of the method to call
      parameters - the named parameters to pass to the method call
      Since:
      2.1
    • destroy

      void destroy()
      Instructs the client to destroy the remote object.
    • setHandler

      void setHandler(OperationHandler handler)
      Set a handler to process incoming operations from the remote object.
      Parameters:
      handler - the handler that processes incoming operation