After you have compiled your source code, you will have to run rmic to compile stubs for the clients. The stub may throw a RemoteException if it has a communication error, however since it must also implement your interface it cannot throw that exception if you don't declare it.
But I want to ask:
never concern with the RemoteException and then I never throw the RemoteException. so,The RemoteException is a redundant Exception??
If not ,who uses it and who generates it ?
The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.
He will have to extend the Remote interface for this to work.
1. In Chun's code, the DataAccessRemote interface doesn't extend the Remote interface, how the stub files will be created then?
The server you create may not ever need to throw a RemoteException. The RemoteException is needed for RMI though. When you run RMIC, you will generate some stubs which handle the communication process for you. They need to be able to pass communication errors to the client method that called them. To do this, the stub can throw RemoteException.
2. I observed that the methods in the DataAccessImpl do not throw the RemoteException "Which is very legal", how will the server then generates remote exception then in case somthing goes wrong?
I think you will find that there are plenty of design issues and problems in creating a server that can safely handle multiple users concurrently as well
and most of the design issue will be on the client side
I think you will find that you cannot do this - since the methods in DataAccess do not throw RemoteException, DataAccessRemote will not be able to do this. What you may find is that there are quite a few posts in this forum from candidates who started down this path and got stuck fairly early on.
I heard of people adopting to such a scenario:What's the idea behind this design? And which interface the exported object should implement?
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton