Package com.complexible.common.curator.framework.locks

# Class NonReentrantCuratorReadWriteLock

java.lang.Object
com.complexible.common.curator.framework.locks.NonReentrantCuratorReadWriteLock

public class NonReentrantCuratorReadWriteLock extends Object
A non-reentrate read-write lock. This implementation is essentially stolen from Curator's `InterProcessReadWriteLock`, but eliminates the re-entrancy. In particular, this allows a person to release the lock with a different thread than the one that acquires it.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NonReentrantCuratorReadWriteLock(org.apache.curator.framework.CuratorFramework client, String basePath)`
  `NonReentrantCuratorReadWriteLock(org.apache.curator.framework.CuratorFramework client, String basePath, byte[] lockData)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `InterProcessTxLock`
  `readLock()`
  Returns the lock used for reading.
  `InterProcessTxLock`
  `writeLock()`
  Returns the lock used for writing.

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

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

- ## Constructor Details

  - ### NonReentrantCuratorReadWriteLock

    public NonReentrantCuratorReadWriteLock(org.apache.curator.framework.CuratorFramework client, String basePath)
    Parameters:
      `client` - the client
      `basePath` - path to use for locking

  - ### NonReentrantCuratorReadWriteLock

    public NonReentrantCuratorReadWriteLock(org.apache.curator.framework.CuratorFramework client, String basePath, byte[] lockData)
    Parameters:
      `client` - the client
      `basePath` - path to use for locking
      `lockData` - the data to store in the lock nodes

- ## Method Details

  - ### readLock

    public InterProcessTxLock readLock()
    Returns the lock used for reading.
    Returns:
      read lock

  - ### writeLock

    public InterProcessTxLock writeLock()
    Returns the lock used for writing.
    Returns:
      write lock