com.hazelcast.config.cp

## Class FencedLockConfig

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

-     public class FencedLockConfig
      extends Object

  Contains configuration options for `FencedLock`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_LOCK_ACQUIRE_LIMIT` Default reentrant lock acquire limit of `FencedLock`.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FencedLockConfig()`
    `FencedLockConfig(String name)`
    `FencedLockConfig(String name, int lockAcquireLimit)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FencedLockConfig` | `disableReentrancy()` Disable reentrancy.
    `FencedLockConfig` | `enableReentrancy()` Enables reentrancy.
    `int` | `getLockAcquireLimit()` Returns the maximum number of lock acquires a lock holder can perform.
    `String` | `getName()` Returns name of the FencedLock
    `FencedLockConfig` | `setLockAcquireLimit(int lockAcquireLimit)` Sets the number of lock acquires a lock holder can perform
    `FencedLockConfig` | `setName(String name)` Sets name of the semaphore

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_LOCK_ACQUIRE_LIMIT

          public static final int DEFAULT_LOCK_ACQUIRE_LIMIT

      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 Detail

    - #### FencedLockConfig

          public FencedLockConfig()

    - #### FencedLockConfig

          public FencedLockConfig(String name)

    - #### FencedLockConfig

          public FencedLockConfig(String name,
                                  int lockAcquireLimit)

  - ### Method Detail

    - #### getName

          public String getName()

      Returns name of the FencedLock

    - #### setName

          public FencedLockConfig setName(String name)

      Sets name of the semaphore

    - #### 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, until 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.

Copyright © 2020. All rights reserved.