org.jgroups.blocks
Interface LockManager
- DistributedLockManager
public interface LockManager
LockManager represents generic lock manager that allows
obtaining and releasing locks on objects.
- Roman Rokytskyy (rrokytskyy@acm.org)
void | lock(Object obj, Object owner, int timeout)- Obtain lock on
obj for specified owner.
|
void | unlock(Object obj, Object owner)- Release lock on
obj owned by specified owner.
|
lock
public void lock(Object obj,
Object owner,
int timeout)
throws LockNotGrantedException,
ClassCastException,
ChannelException Obtain lock on obj for specified owner.
Implementation should try to obtain lock few times within the
specified timeout.
obj - obj to lock, usually not full object but object's ID.owner - object identifying entity that will own the lock.timeout - maximum time that we grant to obtain a lock.
LockNotGrantedException - if lock is not granted within
specified period.ChannelException - if something bad happened to communication
channel.
unlock
public void unlock(Object obj,
Object owner)
throws LockNotReleasedException,
ClassCastException,
ChannelException Release lock on obj owned by specified owner.
obj - obj to lock, usually not full object but object's ID.owner - object identifying entity that will own the lock.
ChannelException - if something bad happened to communication
channel.
Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.