Class FencedLockConfig

java.lang.Object
com.hazelcast.config.cp.FencedLockConfig

public class FencedLockConfig
extends Object
Contains configuration options for FencedLock
  • Field Details

    • DEFAULT_LOCK_ACQUIRE_LIMIT

      public static final int DEFAULT_LOCK_ACQUIRE_LIMIT
      The default reentrant lock acquire limit of FencedLock. 0 means there is no upper bound for number of reentrant lock acquires.
      See Also:
      Constant Field Values
  • Constructor Details

    • FencedLockConfig

      public FencedLockConfig()
    • FencedLockConfig

      public FencedLockConfig​(String name)
    • FencedLockConfig

      public FencedLockConfig​(String name, int lockAcquireLimit)
  • Method Details

    • getName

      public String getName()
      Returns the name of FencedLock
    • setName

      public FencedLockConfig setName​(String name)
      Sets the name of FencedLock
    • getLockAcquireLimit

      public int getLockAcquireLimit()
      Returns the maximum number of lock acquires a lock holder can perform. 0 means no upper-bound on the number of reentrant lock acquires. 1 means the lock is non-reentrant. It can also be bigger than 1.
    • setLockAcquireLimit

      public FencedLockConfig setLockAcquireLimit​(int lockAcquireLimit)
      Sets the number of lock acquires a lock holder can perform.
    • disableReentrancy

      public FencedLockConfig disableReentrancy()
      Disable reentrancy. It means once the lock is acquired, the caller will not be able to acquire it again before it releases the lock.
    • enableReentrancy

      public FencedLockConfig enableReentrancy()
      Enables reentrancy. It means once the lock is acquired, the caller can acquire the lock again many times, without having an upper bound on the number of reentrant acquires.
    • toString

      public String toString()
      Overrides:
      toString in class Object