com.thinkaurelius.titan.diskstorage.locking

## Enum LocalLockMediators

- java.lang.Object
- - java.lang.Enum<LocalLockMediators>
  - - com.thinkaurelius.titan.diskstorage.locking.LocalLockMediators

- All Implemented Interfaces:
    LocalLockMediatorProvider, Serializable, Comparable<LocalLockMediators>

      public enum LocalLockMediators
      extends Enum<LocalLockMediators>
      implements LocalLockMediatorProvider

  A singleton maintaining a globally unique map of `LocalLockMediator` instances.
  Author:
    Dan LaRocque
  See Also:
    `LocalLockMediatorProvider`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `INSTANCE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Only use this in testing.
    `void` | `clear(String namespace)` Only use this in testing.
    `<T> LocalLockMediator<T>` | `get(String namespace, TimestampProvider times)` Returns a the single `LocalLockMediator` responsible for the specified `namespace`.
    `static LocalLockMediators` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static LocalLockMediators[]` | `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

    - #### INSTANCE

          public static final LocalLockMediators INSTANCE

  - ### Method Detail

    - #### values

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

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

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

    - #### get

          public <T> LocalLockMediator<T> get(String namespace,
                                     TimestampProvider times)

      Description copied from interface: `LocalLockMediatorProvider`
      Returns a the single `LocalLockMediator` responsible for the specified `namespace`.

      For any given `namespace`, the same object must be returned every time `get(n)` is called, no matter what thread calls it or how many times.

      For any two unequal namespace strings `n` and `m`, `get(n)` must not equal `get(m)`. in other words, each namespace must have a distinct mediator.
      Specified by:
        `get` in interface `LocalLockMediatorProvider`
      Parameters:
        `namespace` - the arbitrary identifier for a local lock mediator
      Returns:
        the local lock mediator for `namespace`
      See Also:
        `LocalLockMediator`

    - #### clear

          public void clear()

      Only use this in testing.

      This deletes the global map of namespaces to mediators. Calling this in production would result in undetected locking failures and data corruption.

    - #### clear

          public void clear(String namespace)

      Only use this in testing.

      This deletes all entries in the global map of namespaces to mediators whose namespace key equals the argument.

      Parameters:
        `prefix` -

Copyright © 2012–2014. All rights reserved.