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

## Class LockCleaner<T extends Lock>

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

- All Implemented Interfaces:
    `LockMonitoring<T>`

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

  Automatically log and release locks that are no longer referenced and will be garbage collected.
  Author:
    Håvard M. Ottestad

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `LockCleaner.CleanableLock<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 inherited from interface org.eclipse.rdf4j.common.concurrent.locks.diagnostics.LockMonitoring

      `INITIAL_WAIT_TO_COLLECT`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Lock` | `getLock()` |
    `Lock` | `register​(T lock)` |
    `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`

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

      `getLock, requiresManualCleanup, runCleanup`

- - ### Constructor Detail

    - #### LockCleaner

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

  - ### Method Detail

    - #### getLock

          public Lock getLock()
                       throws InterruptedException

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

    - #### tryLock

          public Lock tryLock()

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

    - #### unsafeInnerLock

          public T unsafeInnerLock​(Lock lock)

      Specified by:
        `unsafeInnerLock` 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>`