@Deprecated public interface LockManager
LockManager
represents generic lock manager that allows
obtaining and releasing locks on objects.Modifier and Type | Method and Description |
---|---|
void |
lock(Object obj,
Object owner,
int timeout)
Deprecated.
Obtain lock on
obj for specified owner . |
void |
unlock(Object obj,
Object owner)
Deprecated.
Release lock on
obj owned by specified owner . |
void |
unlock(Object obj,
Object owner,
boolean releaseMultiLocked)
Deprecated.
Release lock on
obj owned by specified owner . |
void lock(Object obj, Object owner, int timeout) throws LockNotGrantedException, ClassCastException, ChannelException
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.ClassCastException
- if obj
and/or
owner
is not of type that implementation expects to get
(for example, when distributed lock manager obtains non-serializable
obj
or owner
).ChannelException
- if something bad happened to communication
channel.void unlock(Object obj, Object owner) throws LockNotReleasedException, ClassCastException, ChannelException
obj
owned by specified owner
.
since 2.2.9 this method is only a wrapper for
unlock(Object lockId, Object owner, boolean releaseMultiLocked).
Use that with releaseMultiLocked set to true if you want to be able to
release multiple locked locks (for example after a merge)obj
- obj to lock, usually not full object but object's ID.owner
- object identifying entity that will own the lock.LockOwnerMismatchException
- if lock is owned by another object.ClassCastException
- if obj
and/or
owner
is not of type that implementation expects to get
(for example, when distributed lock manager obtains non-serializable
obj
or owner
).ChannelException
- if something bad happened to communication
channel.LockNotReleasedException
void unlock(Object obj, Object owner, boolean releaseMultiLocked) throws LockNotReleasedException, ClassCastException, ChannelException, LockMultiLockedException
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.releaseMultiLocked
- force unlocking of the lock if the local
lockManager owns the lock even if another lockManager owns the same lockLockOwnerMismatchException
- if lock is owned by another object.ClassCastException
- if obj
and/or
owner
is not of type that implementation expects to get
(for example, when distributed lock manager obtains non-serializable
obj
or owner
).ChannelException
- if something bad happened to communication
channel.LockMultiLockedException
- if the lock was unlocked, but another
node already held the lockLockNotReleasedException
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.