Class NamedLockFactorySupport

    • Method Detail

      • isDiagnosticEnabled

        public boolean isDiagnosticEnabled()
        Returns true if factory diagnostic collection is enabled.
        Since:
        1.9.11
      • getLock

        public final NamedLock getLock​(java.util.Collection<NamedLockKey> keys)
        Description copied from interface: NamedLockFactory
        Creates or reuses existing NamedLock. Returns instance MUST BE treated as "resource", best in try-with-resource block.
        Specified by:
        getLock in interface NamedLockFactory
        Parameters:
        keys - the lock keys, must not be null and must not be empty collection.
        Returns:
        named lock instance, never null.
      • onFailure

        public <E extends java.lang.Throwable> E onFailure​(E failure)
        Description copied from interface: NamedLockFactory
        Method to notify factory about locking failure, to make it possible to provide more (factory specific) information about factory state when a locking operation failed. Factory may alter provided failure or provide information via some other side effect (for example via logging).

        The default implementation merely does what happened before: adds no extra information.

        Specified by:
        onFailure in interface NamedLockFactory
      • destroyLock

        protected void destroyLock​(NamedLock namedLock)
        Implementation may override this (empty) method to perform some sort of implementation specific cleanup for given lock name. Invoked when reference count for given name drops to zero and named lock was removed.