org.apache.commons.configuration2.sync

## Enum LockMode

- 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
  Version:
    $Id: LockMode.java 1624601 2014-09-12 18:04:36Z oheger $

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `READ` Lock mode READ.
    `WRITE` Lock mode WRITE.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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

    - #### 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 Detail

    - #### values

          public static LockMode[] 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 (LockMode c : LockMode.values())
              System.out.println(c);

      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

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.