Package org.axonframework.common.lock
Enum Class NullLockFactory
- All Implemented Interfaces:
Serializable,Comparable<NullLockFactory>,Constable,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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionobtainLock(String identifier) Obtain a lock for a resource identified by givenidentifier.static NullLockFactoryReturns the enum constant of this class with the specified name.static NullLockFactory[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
Singleton instance of aNullLockFactory.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
obtainLock
Obtain a lock for a resource identified by givenidentifier. Depending on the strategy, this method may return immediately or block until a lock is held. This implementation does nothing.- Specified by:
obtainLockin interfaceLockFactory- Parameters:
identifier- the identifier of the resource to obtain a lock for.- Returns:
- a handle to release the lock.
-