Enum Class LockResult
- All Implemented Interfaces:
Serializable
,Comparable<LockResult>
,Constable
Result code returned by transactional operations which acquire locks.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLock granted for the first time.Lock rejection caused by deadlock.Lock rejection caused by illegal lock mode upgrade.Lock rejection caused by thread interruption.Exclusive lock is already owned, so no extra unlock should be performed.Shared lock is already owned, so no extra unlock should be performed.Upgradable lock is already owned, so no extra unlock should be performed.Lock rejection caused by wait timeout or deadlock.Indicates that the lock isn't owned, or that lock acquisition wasn't performed.Exclusive lock granted as an upgrade from an owned upgradable lock. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if a lock was just acquired.boolean
Returns true if lock was already owned when requested.boolean
isHeld()
Returns true if lock was just acquired or was already owned.boolean
Returns true if lock request timed out.static LockResult
Returns the enum constant of this class with the specified name.static LockResult[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ILLEGAL
Lock rejection caused by illegal lock mode upgrade.- See Also:
-
INTERRUPTED
-
TIMED_OUT_LOCK
Lock rejection caused by wait timeout or deadlock.- See Also:
-
DEADLOCK
Lock rejection caused by deadlock. -
ACQUIRED
Lock granted for the first time. -
UPGRADED
Exclusive lock granted as an upgrade from an owned upgradable lock. -
OWNED_SHARED
Shared lock is already owned, so no extra unlock should be performed. This result is only possible when trying to acquire a shared lock. -
OWNED_UPGRADABLE
Upgradable lock is already owned, so no extra unlock should be performed. This result is possible when trying to acquire a shared or upgradable lock. -
OWNED_EXCLUSIVE
Exclusive lock is already owned, so no extra unlock should be performed. This result is possible when trying to acquire any type of lock. -
UNOWNED
Indicates that the lock isn't owned, or that lock acquisition wasn't performed. Unless returned from an explicit lock check method, this result doesn't imply that the lock is truly unowned.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isTimedOut
public boolean isTimedOut()Returns true if lock request timed out. Applicable toTIMED_OUT_LOCK
. -
isHeld
public boolean isHeld()Returns true if lock was just acquired or was already owned. Applicable toACQUIRED
,UPGRADED
,OWNED_SHARED
,OWNED_UPGRADABLE
, andOWNED_EXCLUSIVE
. -
isAlreadyOwned
public boolean isAlreadyOwned()Returns true if lock was already owned when requested. Applicable toOWNED_SHARED
,OWNED_UPGRADABLE
, andOWNED_EXCLUSIVE
. -
isAcquired
-