Enum Class NullLockFactory

java.lang.Object
java.lang.Enum<NullLockFactory>
org.axonframework.common.lock.NullLockFactory
All Implemented Interfaces:
Serializable, Comparable<NullLockFactory>, Constable, LockFactory

public enum NullLockFactory extends Enum<NullLockFactory> implements LockFactory
LockFactory implementation that does nothing. Can be useful in cases where a Locking Repository implementation needs to be configured to ignore locks, for example in scenario's where an underlying storage mechanism already performs the necessary locking.
Since:
0.6
Author:
Allard Buijze
  • Enum Constant Details

  • Method Details

    • values

      public static NullLockFactory[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NullLockFactory valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • obtainLock

      public Lock obtainLock(String identifier)
      Obtain a lock for a resource identified by given identifier. Depending on the strategy, this method may return immediately or block until a lock is held.

      This implementation does nothing.

      Specified by:
      obtainLock in interface LockFactory
      Parameters:
      identifier - the identifier of the resource to obtain a lock for.
      Returns:
      a handle to release the lock.