com.sleepycat.je.txn
Enum LockGrantType

java.lang.Object
  extended by java.lang.Enum<LockGrantType>
      extended by com.sleepycat.je.txn.LockGrantType
All Implemented Interfaces:
Serializable, Comparable<LockGrantType>

public enum LockGrantType
extends Enum<LockGrantType>

LockGrantType is an enumeration of the possible results of a lock attempt.


Enum Constant Summary
DENIED
          The lock has not been granted because a conflicting lock is held by another locker, and the lock timeout expired or a no-wait lock was requested.
EXISTING
          The locker already owns the requested lock, and no new lock or upgrade is needed.
NEW
          The locker did not previously own a lock on the node, and a new lock has been granted.
NONE_NEEDED
          No lock has been granted because LockType.NONE was requested.
PROMOTION
          The locker previously owned a read lock on the node, and a write lock has been granted by upgrading the lock from read to write.
UNCONTENDED
          No lock is obtained, but the lock is not owned by any locker.
WAIT_NEW
          The locker did not previously own a lock on the node, and must wait for a new lock because a conflicting lock is held by another locker.
WAIT_PROMOTION
          The locker previously owned a read lock on the node, and must wait for a lock upgrade because a conflicting lock is held by another locker.
WAIT_RESTART
          The lock has not been granted because a conflicting lock is held by another locker, and a RangeRestartException must be thrown.
 
Method Summary
static LockGrantType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LockGrantType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NEW

public static final LockGrantType NEW
The locker did not previously own a lock on the node, and a new lock has been granted.


WAIT_NEW

public static final LockGrantType WAIT_NEW
The locker did not previously own a lock on the node, and must wait for a new lock because a conflicting lock is held by another locker.


PROMOTION

public static final LockGrantType PROMOTION
The locker previously owned a read lock on the node, and a write lock has been granted by upgrading the lock from read to write.


WAIT_PROMOTION

public static final LockGrantType WAIT_PROMOTION
The locker previously owned a read lock on the node, and must wait for a lock upgrade because a conflicting lock is held by another locker.


EXISTING

public static final LockGrantType EXISTING
The locker already owns the requested lock, and no new lock or upgrade is needed.


DENIED

public static final LockGrantType DENIED
The lock has not been granted because a conflicting lock is held by another locker, and the lock timeout expired or a no-wait lock was requested.


WAIT_RESTART

public static final LockGrantType WAIT_RESTART
The lock has not been granted because a conflicting lock is held by another locker, and a RangeRestartException must be thrown.


NONE_NEEDED

public static final LockGrantType NONE_NEEDED
No lock has been granted because LockType.NONE was requested.


UNCONTENDED

public static final LockGrantType UNCONTENDED
No lock is obtained, but the lock is not owned by any locker. Used to avoid locking an LSN just prior to logging a node and updating the LSN.

Method Detail

values

public static LockGrantType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LockGrantType c : LockGrantType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LockGrantType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
NullPointerException - if the argument is null


Copyright (c) 2004-2012 Oracle. All rights reserved.