com.unclouded.android
Class RemoteReference

java.lang.Object
  extended by com.unclouded.android.RemoteReference

public class RemoteReference
extends Object

Provides a reference to an object hosted by another device.

Remote references are returned upon discovering a service referencing a UObject. To interact with this object, remote references only allow asynchronous method invocations. These are invocations that are non-blocking and immediately return a Promise object.


Constructor Summary
RemoteReference()
           
 
Method Summary
 Promise asyncInvoke(String selector, Serializable... args)
          Asynchronously invoke a method of the referenced object.
 boolean equals(Object obj)
          Indicates whether some object is equal to this remote reference.
 int hashCode()
          Returns a hash code value for the remote reference.
 String toString()
          Returns a string representation of a RemoteReference object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteReference

public RemoteReference()
Method Detail

asyncInvoke

public Promise asyncInvoke(String selector,
                           Serializable... args)
Asynchronously invoke a method of the referenced object.

Parameters:
selector - the name of the method to invoke.
args - additional arguments of the remote method invocation. Arguments are passed by copy and should therefore be Serializable.
Returns:
a promise object awaiting the return value to be resolved.

toString

public String toString()
Returns a string representation of a RemoteReference object.

Overrides:
toString in class Object
Returns:
a string representation of the remote reference.

equals

public boolean equals(Object obj)
Indicates whether some object is equal to this remote reference.

Overrides:
equals in class Object
Parameters:
obj - the object with which to compare.
Returns:
true if this remote reference is the same as the obj argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the remote reference.

Overrides:
hashCode in class Object
Returns:
a hash code value for this remote reference.