public abstract class RemoteObject extends Object implements Remote, Serializable
RemoteObjectclass implements the
java.lang.Objectbehavior for remote objects.
RemoteObjectprovides the remote semantics of Object by implementing methods for hashCode, equals, and toString.
- See Also:
- Serialized Form
Fields Modifier and Type Field Description
protected RemoteRefThe object's remote reference.
Constructors Modifier Constructor Description
()Creates a remote object.
RemoteRef newref)(Creates a remote object, initialized with the specified remote reference.
Modifier and Type Method Description
Object obj)(Compares two remote objects for equality.
()Returns the remote reference for the remote object.
()Returns a hashcode for a remote object.
()Returns a String that represents the value of this remote object.
Remote obj)(Returns the stub for the remote object
objpassed as a parameter.
refprotected transient RemoteRef refThe object's remote reference.
RemoteObjectprotected RemoteObject()Creates a remote object.
RemoteObjectprotected RemoteObject(RemoteRef newref)Creates a remote object, initialized with the specified remote reference.
newref- remote reference
getRefpublic RemoteRef getRef()Returns the remote reference for the remote object.
Note: The object returned from this method may be an instance of an implementation-specific class. The
RemoteObjectclass ensures serialization portability of its instances' remote references through the behavior of its custom
readObjectmethods. An instance of
RemoteRefshould not be serialized outside of its
RemoteObjectwrapper instance or the result may be unportable.
- remote reference for the remote object
toStubReturns the stub for the remote object
objpassed as a parameter. This operation is only valid after the object has been exported.
obj- the remote object whose stub is needed
- the stub for the remote object,
NoSuchObjectException- if the stub for the remote object could not be found.
hashCodepublic int hashCode()Returns a hashcode for a remote object. Two remote object stubs that refer to the same remote object will have the same hash code (in order to support remote objects as keys in hash tables).
equalspublic boolean equals(Object obj)Compares two remote objects for equality. Returns a boolean that indicates whether this remote object is equivalent to the specified Object. This method is used when a remote object is stored in a hashtable. If the specified Object is not itself an instance of RemoteObject, then this method delegates by returning the result of invoking the
equalsmethod of its parameter with this remote object as the argument.
toStringpublic String toString()Returns a String that represents the value of this remote object.