Enum LockMode
- All Implemented Interfaces:
Serializable
,Comparable<LockMode>
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
-
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.
-
-
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
-