Package org.eclipse.rdf4j.common.concurrent.locks.diagnostics

## Class LockTracking<T extends Lock>

- java.lang.Object
- - org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockTracking<T>

- All Implemented Interfaces:
    `LockMonitoring<T>`

      @InternalUseOnly
      public class LockTracking<T extends Lock>
      extends Object
      implements LockMonitoring<T>

  Full tracking of locks with simple deadlock detection and logging as well as automatic release of abandoned locks (same as LockCleaner).
  Author:
    Håvard M. Ottestad

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `LockTracking.SimpleLock<T extends Lock>` |

    - ### Nested classes/interfaces inherited from interface org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockMonitoring

      `LockMonitoring.Wrapper<T extends Lock>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `LOGGED_STALLED_LOCKS_MINIMUM_WAIT_TO_COLLECT` |

    - ### Fields inherited from interface org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockMonitoring

      `INITIAL_WAIT_TO_COLLECT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LockTracking​(boolean stacktrace, String alias, org.slf4j.Logger logger, int waitToCollect, Lock.ExtendedSupplier<T> supplier)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Lock` | `getLock()` |
    `Lock` | `getLock​(String alias)` |
    `Lock` | `register​(T lock)` |
    `boolean` | `requiresManualCleanup()` |
    `void` | `runCleanup()` |
    `Lock` | `tryLock()` |
    `void` | `unregister​(Lock lock)` |
    `T` | `unsafeInnerLock​(Lock lock)` |

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

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

- - ### Field Detail

    - #### LOGGED_STALLED_LOCKS_MINIMUM_WAIT_TO_COLLECT

          public static final int LOGGED_STALLED_LOCKS_MINIMUM_WAIT_TO_COLLECT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LockTracking

          public LockTracking​(boolean stacktrace,
                              String alias,
                              org.slf4j.Logger logger,
                              int waitToCollect,
                              Lock.ExtendedSupplier<T> supplier)

  - ### Method Detail

    - #### runCleanup

          public void runCleanup()

      Specified by:
        `runCleanup` in interface `LockMonitoring<T extends Lock>`

    - #### getLock

          public Lock getLock()
                       throws InterruptedException

      Specified by:
        `getLock` in interface `LockMonitoring<T extends Lock>`
      Throws:
        `InterruptedException`

    - #### getLock

          public Lock getLock​(String alias)
                       throws InterruptedException

      Specified by:
        `getLock` in interface `LockMonitoring<T extends Lock>`
      Throws:
        `InterruptedException`

    - #### unsafeInnerLock

          public T unsafeInnerLock​(Lock lock)

      Specified by:
        `unsafeInnerLock` in interface `LockMonitoring<T extends Lock>`

    - #### tryLock

          public Lock tryLock()

      Specified by:
        `tryLock` in interface `LockMonitoring<T extends Lock>`

    - #### requiresManualCleanup

          public boolean requiresManualCleanup()

      Specified by:
        `requiresManualCleanup` in interface `LockMonitoring<T extends Lock>`

    - #### register

          public Lock register​(T lock)

      Specified by:
        `register` in interface `LockMonitoring<T extends Lock>`

    - #### unregister

          public void unregister​(Lock lock)

      Specified by:
        `unregister` in interface `LockMonitoring<T extends Lock>`