next up previous contents
Next: Future Improvements Up: The Basic Services Previous: Future Improvements

The HsResourceControlService

  Although it is possible to implement synchronized methods within the context of a single Java VM by means of the synchronized key word, it is impossible to guarantee locks outside that scope. To allow for locking, Haystack includes a resource control service, HsResourceControlService. This service allows for locking and unlocking of arbitrarily named resources. Locks are held for a preset amount of time (currently 5 minutes).

The methods currently implemented by HsResourceControlService are:

The HsResourceControlService internally maintains an extension to the Hashtable class called ResourceControlHash. The ResourceControlHash maintains a list of current resources as well as a list of their timeouts. The ResourceControlHash manages the synchronization necessary to ensure atomic lock functionality.





Copyright 1998, Eytan Adar (eytan@alum.mit.edu)