RMI Level I RMI Level II Introduction How to Open How to Start How It Works Trouble Shooting Comments? RMI Wizard Tutorial SCJD Study Companion |
IntroductionRMI Wizard is designed for new RMI designers to get familiar with the recipe of RMI system. It helps reduce compiling and coding problems which most of programmers suffered when having the first try. It is a good practice to use it to generate a template RMI system and modify the generated code to your needs. Using this Wizard to develop your RMI server for SCJD assignment, you need to recheck the code to make sure thread-safety. If you have no idea about RMI system, this Wizard will help you learn and understand RMI system quickly. But you are recommended to read RMI Level I tutorial at least to start using RMI Wizard. If you are not familiar with RMI server with adapter design pattern, you may either learn it from the generated code or read Adapter Design Pattern. Since this is a learning tool, you cannot use it to design a callback, or set dynamically class loading directly. How to openWhen you download the RMITool.jar file, unjar it on the command line: >jar -xf RMITool.jarTo run it on the command line: >java -jar RMIWizard.jarDownload -Under updating now How to StartA source file named BankAccount is provided with this Wizard for your practice. To ensure the successful creation, check the prerequisite first:
Steps:
You can run your server and client at the same directory because the different JVM will be launched for each program. New RMI designers may confuse with it. You can do your assignment in the same way. NOTES: All of the generated names should be changed to those without "_" underscore to meet Java code convention. How It WorksThe RMI Server and client are created based on the data you entered. RMI server is designed with adapter pattern with less code change of your local class and highly flexibility. If you want to add more functionality, just modify the code of the server without alteration of the remote object. The four files are generated for the RMI system.
The remote object name is : yourEnteredClassNameObj. The two batch files are generated for you to try RMI system immediately.
If you want to try your assignment, make a default Data constructor first and generate code and then modify the code to your needs. For how to make your RMI server thread-safe and how to shut down your server gracefully, see Server Design & Implementation. Trouble ShootingIf you failed to compile the generated files, check the generated files. If the methods you entered are not existing in your local class, the RMI server won't be created. Use the list button on the left to list the public methods in your class automatically. Check if the public method in the Object class has been listed, if so, it won't compile. Like toString() method, because such method in the super class doesn't throw remote exception. If you get access denied exception, check the policy file location and name. Comments?A good comment will be rewarded by having the SCJD Study Companion for free. Please send your comments to GUI with subject "Comments", so your E-mail will get attention quickly. A new version of RMI Wizard will give you a choice to have auto or manually register the remote object. Dynamically class loading feature will be added in. "Server Design & Implementation" is a part of SCJD Study Companion. It is not available for the RMI tool. |