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
public abstract class LockException extends Exception
ALockException
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 benull
since it may be unknown or there may not be a lock at all.- Author:
- Ulrich Kreher
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LockException(Object lockedObject, Object lockOwner, String lockType)
Creates a new lock exception indicating that the designatedlockedObject
can not be locked or unlocked since it is locked by the designated for thelockOwner
for the designated lock type.protected
LockException(Object lockedObject, String lockType)
Creates a new lock exception indicating that the designatedlockedObject
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getLockedObject()
Returns the object that is to be locked or unlocked.Object
getLockOwner()
Returns the object that currently has the lock ornull
in case the lock owner is unknown or there is no lock at all.String
getLockType()
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 Detail
-
LockException
protected LockException(Object lockedObject, String lockType)
Creates a new lock exception indicating that the designatedlockedObject
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.- 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
protected LockException(Object lockedObject, Object lockOwner, String lockType)
Creates a new lock exception indicating that the designatedlockedObject
can not be locked or unlocked since it is locked by the designated for thelockOwner
for 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 Detail
-
getLockedObject
public Object getLockedObject()
Returns the object that is to be locked or unlocked.- Returns:
- The object that is to be locked or unlocked.
-
getLockOwner
public Object getLockOwner()
Returns the object that currently has the lock ornull
in case the lock owner is unknown or there is no lock at all.- Returns:
- The object that currently has the lock or
null
in case the lock owner is unknown or there is no lock at all.
-
getLockType
public String 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.
-
-