Enum LockMode
- All Implemented Interfaces:
Serializable
,Comparable<LockMode>
,java.lang.constant.Constable
An enumeration used by SynchronizerSupport
to specify how an object is locked.
The SynchronizerSupport
interface allows locking an object. This can be done in different ways controlling
the level of concurrency still possible with the object. One of the constants defined here can be passed in when
calling the lock()
method of a SynchronizerSupport
object. (Note that at the end of the day it is up
to a concrete implementation of Synchronizer
how these lock modes are interpreted.)
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Constructor Summary
Constructors -
Method Summary
-
Enum Constant Details
-
READ
Lock mode READ. The object is accessed in a read-only manner. Typically, this means that other read locks can be granted while concurrent writes are not permitted. -
WRITE
Lock mode WRITE. The object is updated. This usually means that this object is exclusively locked. Attempts of other readers or writers will block until the current update operation is complete.
-
-
Constructor Details
-
LockMode
private LockMode()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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 nameNullPointerException
- if the argument is null
-