Package de.aristaflow.adept2.util
Class LockException
java.lang.Object
java.lang.Throwable
java.lang.Exception
de.aristaflow.adept2.util.LockException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AcquireLockException,ReleaseLockException
A
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.- Author:
- Ulrich Kreher
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLockException(Object lockedObject, Object lockOwner, String lockType) Creates a new lock exception indicating that the designatedlockedObjectcan not be locked or unlocked since it is locked by the designated for thelockOwnerfor the designated lock type.protectedLockException(Object lockedObject, String lockType) Creates a new lock exception indicating that the designatedlockedObjectcan 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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the object that is to be locked or unlocked.Returns the object that currently has the lock ornullin case the lock owner is unknown or there is no lock at all.Returns the type of the lock which is currently held or which is to be released.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LockException
Creates a new lock exception indicating that the designatedlockedObjectcan 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.- Parameters:
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.
-
LockException
Creates a new lock exception indicating that the designatedlockedObjectcan not be locked or unlocked since it is locked by the designated for thelockOwnerfor the designated lock type.- Parameters:
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.
-
-
Method Details
-
getLockedObject
Returns the object that is to be locked or unlocked.- Returns:
- The object that is to be locked or unlocked.
-
getLockOwner
Returns the object that currently has the lock ornullin case the lock owner is unknown or there is no lock at all.- Returns:
- The object that currently has the lock or
nullin case the lock owner is unknown or there is no lock at all.
-
getLockType
Returns the type of the lock which is currently held or which is to be released.- Returns:
- The type of the lock which is currently held or which is to be released.
-