![]() |
CPS 212: Distributed Information Systems | ![]() |
|||||
|
|||||||
Due Date: 10/24/2007 before class.
Your goal in this assignment is to produce a simple distributed lock server and client using Java Remote Method Invocation (RMI). Your lock service will be similar to the locking mechanisms used in distributed file systems such as AFS, NQ-NFS, and Frangipani.
To application threads running in a client, a lock is an instance of a Mutex class with Acquire and Release primitives that enforce mutual exclusion across threads. To the client (e.g., your Mutex class implementation), the lock service should appear as a class called LeasedToken that implements a Remote interface with Acquire and Release methods to provide mutual exclusion among threads running on different clients. (The client may obtain instances of LeasedToken by name from the RMI registry.)
There exist a variety of distributed mutual exclusion protocols with varying degrees of decentralization and fault tolerance (see the text). Implementing the locks in RMI will force us to use a less reliable and less scalable approach in which the current state of each lock is represented at a fixed location, e.g., a centralized server. However, clients can cache lock tokens and leases as the basis for a lock service that is reasonably scalable and tolerant of most client and network failures.
Your lock system should provide the following semantics and behavior:
Implement some tests to demonstrate that your lock service is correct.
Note: you may use any classes from the Java environment in your implementation. Java includes several classes with functionality related to this assignment, including one called Lease. I suspect that these classes will not be useful for this assignment, but you are welcome to use them if they turn out to be useful.
You may use SOAP or XMLRPC instead of RMI if you prefer.