public class ReleaseLockException extends LockException
ReleaseLockException indicates that the lock on an object
can not be released since the releasing object does not have the lock. This
is usually a programming error since unlocking should always have a
corresponding lock some time before.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
locked
Whether the object is already locked (but not by the lock releasing object)
or is not locked at all.
|
protected java.lang.Object |
lockReleasingObject
The object trying to release the lock (but failing).
|
| Constructor and Description |
|---|
ReleaseLockException(java.lang.Object lockedObject,
boolean locked,
java.lang.Object lockReleasingObject,
java.lang.String lockType)
Creates a new lock exception indicating that the designated
lockReleasingObject can not unlock the designated
lockedObject but the current lock owner is unknown or the
object is not locked at all. |
ReleaseLockException(java.lang.Object lockedObject,
java.lang.Object lockOwner,
java.lang.Object lockReleasingObject,
java.lang.String lockType)
Creates a new lock exception indicating that the designated
lockReleasingObject can not unlock the designated
lockedObject since it does not have the lock but the
lockOwner has. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getLockReleasingObject()
Returns the object that wants to release the lock.
|
java.lang.String |
getMessage() |
boolean |
isLocked()
Wether the exception occurred due to another object having the lock (
true)
or having no lock at all (false). |
getLockedObject, getLockOwner, getLockTypeprotected final boolean locked
protected final java.lang.Object lockReleasingObject
public ReleaseLockException(java.lang.Object lockedObject,
boolean locked,
java.lang.Object lockReleasingObject,
java.lang.String lockType)
lockReleasingObject can not unlock the designated
lockedObject but the current lock owner is unknown or the
object is not locked at all.lockedObject - The object that is currently locked and that should be
unlocked.locked - Whether the object is locked (and the lock owner is unknown).lockReleasingObject - The object that wanted to release the lock which
led to the created exception.lockType - The type of the lock which can not be released.public ReleaseLockException(java.lang.Object lockedObject,
java.lang.Object lockOwner,
java.lang.Object lockReleasingObject,
java.lang.String lockType)
lockReleasingObject can not unlock the designated
lockedObject since it does not have the lock but the
lockOwner has.lockedObject - The object that is currently locked and that should be
unlocked.lockOwner - The object that currently locks the object.lockReleasingObject - The object that wanted to release the lock which
led to the created exception.lockType - The type of the lock which can not be released.public boolean isLocked()
true)
or having no lock at all (false).public java.lang.Object getLockReleasingObject()
public java.lang.String getMessage()
getMessage in class java.lang.Throwable