com.hammurapi.store

## Class DeputyReadWriteLock

- java.lang.Object
- - com.hammurapi.store.DeputyReadWriteLock

- All Implemented Interfaces:
    ReadWriteLock

      public class DeputyReadWriteLock
      extends Object
      implements ReadWriteLock

  This lock acts on behalf of another lock and acquires its own locks only if the master doesn't hold corresponding locks. This class is used to distribute store operations to multiple threads/processes.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DeputyReadWriteLock(DeputyLock readLock, DeputyLock writeLock)`
    `` | `DeputyReadWriteLock(ReadWriteLock master, boolean readLocked, boolean writeLocked)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DeputyReadWriteLock` | `createDeputy()`
    `Lock` | `readLock()`
    `Lock` | `writeLock()`

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

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

- - ### Constructor Detail

    - #### DeputyReadWriteLock

          public DeputyReadWriteLock(ReadWriteLock master,
                             boolean readLocked,
                             boolean writeLocked)

    - #### DeputyReadWriteLock

          protected DeputyReadWriteLock(DeputyLock readLock,
                             DeputyLock writeLock)

  - ### Method Detail

    - #### readLock

          public Lock readLock()

      Specified by:
        `readLock` in interface `ReadWriteLock`

    - #### writeLock

          public Lock writeLock()

      Specified by:
        `writeLock` in interface `ReadWriteLock`

    - #### createDeputy

          public DeputyReadWriteLock createDeputy()