java.lang.Object
java.lang.Enum<LockMode>
org.apache.commons.configuration2.sync.LockMode
All Implemented Interfaces:
Serializable, Comparable<LockMode>

public enum LockMode extends Enum<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

      public static final LockMode 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

      public static final LockMode 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

      public static LockMode[] 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

      public static LockMode 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