There is a DLM that's part of JGroups but it is somewhat unsupported (I didn't write it and the guy who did is too busy to support it): http://www.koders.com/java/fidC73888EED1C2ECCDD56AF33274914F9AB36641F7.aspx?s=DistributedLockManager
The existing DLM is also a bit costly, as it does a 2-phase lock acquisition phase. Also, IIRC it requires total consensus, not majority-based consensus as you described above.
You also have to solve the issue where a member which is currently holding the lock crashes. In this case, you have to release all the locks held by a crashed member.
If you submit a concise spec then something like what you described could be implemented in a few days...
Perhaps something similar to the DLM in JGroups could be implemented as a part of a common clustering library, as I think it takes away from JGroups' core focus to have it reside in JGroups. (IMO)
Re: the problem of the lock owner crashing, surely JGroups FD can kick in, and when a new view is issued, locks held by missing members can be automatically released?
Further, timeouts can be applied to ensure locks cannot be held forever, although this may undermine the purpose of the lock in the first place. Replicated deadlock, anyone? :-)
The issue of releasing locks from crashed members has already been solved and is part of the current DLM, I just mentioned it as one of the issues for a potential re-implementation.
Yes, leasing of locks could help preventing distributed deadlocks, this could be part of a new implementation.
Pls see this thread which is related