code_junkie

How to lock a file on different application levels

Nov 13th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. server1
  2. +- servlet container
  3. +- application1
  4. | +- thread1
  5. | +- thread2
  6. +- application2
  7. +- thread1
  8. +- thread2
  9. server2
  10. +- servlet container
  11. +- application1
  12. | +- thread1
  13. | +- thread2
  14. +- application2
  15. +- thread1
  16. +- thread2
  17.  
  18. abstract class MyWriter{
  19. private FileChannel file;
  20. public void writeSomething(byte[] b){
  21. // get VM scope write lock here
  22. // get file lock here
  23. // do write
  24. // release file lock
  25. // release readwritelock lock
  26. }
  27. }
Add Comment
Please, Sign In to add comment