Best Regards <br /> <br />Omar F. Kalaldah<br />---------------------<br />SCJP, SCJD, SCBCD
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?
Best Regards <br /> <br />Omar F. Kalaldah<br />---------------------<br />SCJP, SCJD, SCBCD
Originally posted by Omar Kalaldeh:
I am not sure if the picture gets clear.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I want to konw what different between using the synchronized the LockMap and synchronized at method? likes , and which way is better?
B.S. University of Wisconsin<br />SCJP 1.4 (85%)<br />SCJD 1.4 (92%) B&S Contractors
Don't get me started about those stupid light bulbs. |