|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<LockMode>
org.multiverse.api.LockMode
public enum LockMode
Using the LockMode one can control the pessimistic nature of a Txn.
Normally transactions are very optimistic (e.g. fail during execution or at the end because some read or
write conflict was detected), but in some cases a more pessimistic approach is better. For more information
see Lock.
TxnFactoryBuilder.setReadLockMode(LockMode),
TxnFactoryBuilder.setWriteLockMode(LockMode),
TxnConfig.getReadLockMode(),
TxnConfig.getWriteLockMode(),
TxnObject.getLock(),
Lock| Enum Constant Summary | |
|---|---|
Exclusive
The ExclusiveLock can be compared with the writelock of a traditional read/write lock. |
|
None
No locking is done. |
|
Read
The LockMode.Read prevents others to acquire the Write/Exclusive-lock, but it allows others to acquire the Read lock. |
|
Write
The LockMode.Write prevents others to acquire the Read/Write/Exclusive-lock. |
|
| Field Summary |
|---|
| Fields inherited from interface org.multiverse.MultiverseConstants |
|---|
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED |
| Method Summary | |
|---|---|
int |
asInt()
|
static LockMode |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static LockMode[] |
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 |
|---|
public static final LockMode None
public static final LockMode Read
public static final LockMode Write
public static final LockMode Exclusive
The ExclusiveLock is the Lock acquired by the STM once a Txn is prepared for writing changes to a TxnObject.
| Method Detail |
|---|
public static LockMode[] values()
for (LockMode c : LockMode.values()) System.out.println(c);
public static LockMode valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic int asInt()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||