Class ResourceAutoClosableLockManager<T>

  • Type Parameters:
    T - Type of the resource

    public class ResourceAutoClosableLockManager<T>
    extends java.lang.Object
    This class maintains a map from resource of a certain type to its lock. Its purpose is to support fine granular locking
    • Constructor Detail

      • ResourceAutoClosableLockManager

        public ResourceAutoClosableLockManager​(@Nonnull
                                               java.util.function.Supplier<java.util.concurrent.locks.Lock> lockCreator)
    • Method Detail

      • getLockForResource

        public AutoCloseableLock getLockForResource​(@Nonnull
                                                    T resource)
      • removeLockForResource

        public void removeLockForResource​(@Nonnull
                                          T resource)
      • removeAllLocks

        public void removeAllLocks()