Class AbstractWeakKeyBasedLockFactory<L>

    • Constructor Detail

      • AbstractWeakKeyBasedLockFactory

        protected AbstractWeakKeyBasedLockFactory()
    • Method Detail

      • getLock

        public L getLock​(Object key)
        Description copied from interface: KeyBasedLockFactory
        Returns a lock for the specified key. Implementations will normally do the following: when the first thread calls this method with a key, a new lock is created and returned. When a second, third and so on concurrent thread tries to get a lock for the same key, the first lock is returned, thus allowing synchronization based on the key.
        Specified by:
        getLock in interface KeyBasedLockFactory<L>
        Parameters:
        key - the key associated with the lock
        Returns:
        the lock
      • newLock

        protected abstract L newLock()