Class NamedLockFactorySupport

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.slf4j.Logger logger  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void closeLock​(java.lang.String name)  
      protected abstract NamedLockSupport createLock​(java.lang.String name)
      Implementations shall create and return NamedLockSupport for given name, this method must never return null.
      protected void destroyLock​(java.lang.String name)
      Implementation may override this (empty) method to perform some sort of implementation specific cleanup for given lock name.
      NamedLockSupport getLock​(java.lang.String name)
      Creates or reuses existing NamedLock.
      boolean isDiagnosticEnabled()
      Returns true if factory diagnostic collection is enabled.
      <E extends java.lang.Throwable>
      E
      onFailure​(E failure)
      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.
      void shutdown()
      Performs a clean shut down of the factory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
    • Method Detail

      • isDiagnosticEnabled

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

        public NamedLockSupport getLock​(java.lang.String name)
        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:
        name - the lock name, must not be null.
        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
      • closeLock

        public void closeLock​(java.lang.String name)
      • destroyLock

        protected void destroyLock​(java.lang.String name)
        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.