Satish,
In the getRemote() method DVDConnector class, we are returning DVDDatabaseImpl that is registered with the name DVDMediator(in RMI Registry) in the RegDVDDatabase class. Does this registering of object done for each remote client or is it done only once?
The RMI server object itself is registered once, when it is bound into the registry via code like Naming.rebind("DVDMediator", aDVD).
If its done only once then all remote clients have access to the same DVDDatabaseImpl object, right?
Yes.
Or though registering is done only once, RMI serves each remote client with a different object of DVDDatabaseImpl class?
Each client has an object to work with that is local to its JVM. That object is an instance of the rmic generated RMI stub class. It acts as a proxy for the remote server object. Therefore, each client is working with the original server object, but only indirectly through the proxy.
I hope that clarifies things for you.
[ February 19, 2004: Message edited by: Ken Krebs ]
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg