Hello,
Am using RMI for networking portion and plan to extend the Data class to and implement the same functionality as UnicastRemoteObject. In the
Java RMI Tutorial is the following:
UnicastRemoteObject is a convenience class, defined in the RMI public API, that can be used as a superclass for remote object implementations. The superclass UnicastRemoteObject supplies implementations for a number of java.lang.Object methods (equals, hashCode, toString) so that they are defined appropriately for remote objects. UnicastRemoteObjectalso includes constructors and static methods used to export a remote object, that is, make the remote object available to receive incoming calls from clients.
A remote object implementation does not have to extend UnicastRemoteObject, but any implementation that does not must supply appropriate implementations of the java.lang.Object methods. Furthermore, a remote object implementation must make an explicit call to one of UnicastRemoteObject's exportObject methods to make the RMI runtime aware of the remote object so that the object can accept incoming calls. By extending UnicastRemoteObject, the ComputeEngine class can be used to create a simple remote object that supports unicast (point-to-point) remote communication and that uses RMI's default sockets-based transport for communication.
If you choose to extend a remote object from any class other than Unicast-RemoteObject or, alternatively, extend from the new JDK 1.2 class java.rmi.activation.Activatable (used to construct remote objects that can execute on demand), you need to export the remote object by calling either the UnicastRemoteObject.exportObject or Activatable.exportObject method explicitly from your class's constructor (or another initialization method, as appropriate).
Question--how to get a look at the Java code for UnicastRemoteObject to see how the Object methods are implemented? As well, how does UnicastRemoteObject call exportObject? With "this" as the argument?
thanks!