


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Distributed Operating Systems course is designed to examine the fundamental principles of distributed systems, and provide students hands-on experience in developing distributed protocols. This assignment includes: Distributed Banking System, Automated Teller Machine, Program Requirement, Java, Design Requirement, Interface, Server Object, Server Address
Typology: Exercises
1 / 4
This page cannot be seen from the preview
Don't miss anything!



A distributed banking system consists of a server and some Automated Teller Machines (ATM). The server manages all users’ account information. A customer can invoke the following operations at an ATM.
You are required to write this client-server (banking system) program which communicates via RPC. You are recommended to develop this system using JAVA/RMI (the functionality comes in the package java.rmi). You are free to use other RPC-like languages instead of JAVA/RMI, as long as your code can perform the same operations mentioned above. Specifically, your program should consist of two parts: one for the client and another for the server. The client (as the ATM) will initiate RPC by sending request message to the bank server to execute a specified procedure (e.g. deposit) with parameters. Recall the sequence of events during a RPC:
You can use the following interface and class definitions as a starting point for your project. However, you are free to develop your own interface and class definitions.
1 Interface public interface BankInterface extends Remote { public void deposit(int account, int amount) throws RemoteException; public void withdraw(int account, int amount) throws RemoteException; public int inquiry(int account) throws RemoteException; } 2 Server Object public class Bank extends unicastRemoteObject implements BankInterface { private Vector userAccount; //users’ account private Vector userBalance; //users’ balance public Bank() throws RemoteException { } public void deposit(int account, int amount) throws RemoteException { //implementations } public void withdraw(int account, int amount) throws RemoteException { //implementations } public int inquiry(int account) throws RemoteException { //implementations } public static void main(String args[]) throws Exception { //init Bank server } } Initially, the Bank server should have the following data in its database ( userAccount, userBalance in the above example code) Account Balance 100 $10 00 The bank server has only one input parameter “server_port”, which specifies the port of rmiregistry. The default port of rmiregistry is 1099, but we may have to use other ports, if 1099 has already been used by some other programs.