what is raf? I am assuming its the file object.
I think You should put the synchronization block on the Map object.
No need to throw exception when waiting thread get Interrupted.
Should throw securityException not IllegalArgumentException.
I have a LockCookieGenerator to generate the unique cookie.
I turn the concept of DataAdapter into session facade so that the Data is a singleton. So I can use "synchronized" on the Data object, say the methods in Data other than modifying database are synchronized. I also model the lock as a object, not a pair of cookie/recNo values.
You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.
Just for the lock and unlock methods, or for all of them? What is the reason for this?
Originally posted by Omar Kalaldeh:
I am not sure if the picture gets clear.
I want to konw what different between using the synchronized the LockMap and synchronized at method? likes , and which way is better?
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!https://www.kickstarter.com/projects/paulwheaton/greenhouse-1