This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
RemoteServicesImpl extends UnicastRemoteObject and implements RemoteServices. It has 2 parts, the implementation of RemoteServices (i.e. the 2 Services methods) and static getServices methods that allow the clients to get a Services instance that is either an RMI server for the Network Server application functionality or its stub for the Network Client application functionality.
I don't understand the bit in bold. How do you mean it reterns a "RMI server for the Network Server application functionality"? I simply do this when starting the RMI registry:
Isn't the stubbing handled automatically by RMI? I.E. I bind remoteDBServices on the server side, but when the client requests it, a stub is returned. Anyway, my app is working fine, I just want to understand what you meant. Or do you mean you just put those to things: binding the server, and getting the stub, inside static methods? Thanx again. Jacques
Or do you mean you just put those to things: binding the server, and getting the stub, inside static methods?
Yes. I put them in the RemoteServicesImpl class. Keep in mind that I did this only because the rmi requirements of my app are simple. If they were more complex with many server/stub combinations that were interconnected, I would probably relocate these methods to some sort of class that manages my rmi connections.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg