public abstract class LockException
extends java.lang.Exception
LockException indicates that an object can not be locked or
unlocked due to being locked (by the wrong object). The exception provides
the locked object, the lock owner as well as the type of lock currently held
or to be released. The lock owner may be null since it may be
unknown or there may not be a lock at all.| Modifier | Constructor and Description |
|---|---|
protected |
LockException(java.lang.Object lockedObject,
java.lang.Object lockOwner,
java.lang.String lockType)
Creates a new lock exception indicating that the designated
lockedObject can not be locked or unlocked since it is
locked by the designated for the lockOwner for the
designated lock type. |
protected |
LockException(java.lang.Object lockedObject,
java.lang.String lockType)
Creates a new lock exception indicating that the designated
lockedObject can not be locked or unlocked due to the (lack
of) a lock of the designated type and the current lock owner is unknown or
there is no lock at all. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getLockedObject()
Returns the object that is to be locked or unlocked.
|
java.lang.Object |
getLockOwner()
Returns the object that currently has the lock or
null in
case the lock owner is unknown or there is no lock at all. |
java.lang.String |
getLockType()
Returns the type of the lock which is currently held or which is to be
released.
|
protected LockException(java.lang.Object lockedObject,
java.lang.String lockType)
lockedObject can not be locked or unlocked due to the (lack
of) a lock of the designated type and the current lock owner is unknown or
there is no lock at all.lockedObject - The object that is should be locked or unlocked.lockType - The type of the lock which is currently held on the object
or should be released.protected LockException(java.lang.Object lockedObject,
java.lang.Object lockOwner,
java.lang.String lockType)
lockedObject can not be locked or unlocked since it is
locked by the designated for the lockOwner for the
designated lock type.lockedObject - The object that is should be locked or unlocked.lockOwner - The object that currently locks the object.lockType - The type of the lock which is currently held on the object
or should be released.public java.lang.Object getLockedObject()
public java.lang.Object getLockOwner()
null in
case the lock owner is unknown or there is no lock at all.null in
case the lock owner is unknown or there is no lock at all.public java.lang.String getLockType()