Class ReadWriteLockNamedLock

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NamedLock

    public class ReadWriteLockNamedLock
    extends NamedLockSupport
    Named lock support implementation that is using ReadWriteLock instances. The adapted lock MUST SUPPORT reentrancy, non re-entrant locks will NOT work. It is the responsibility of an adapting lock, to ensure that above lock requirement stands.
    • Field Detail

      • readWriteLock

        private final java.util.concurrent.locks.ReadWriteLock readWriteLock
    • Constructor Detail

      • ReadWriteLockNamedLock

        public ReadWriteLockNamedLock​(java.lang.String name,
                                      NamedLockFactorySupport factory,
                                      java.util.concurrent.locks.ReadWriteLock readWriteLock)
    • Method Detail

      • doLockShared

        protected boolean doLockShared​(long time,
                                       java.util.concurrent.TimeUnit unit)
                                throws java.lang.InterruptedException
        Specified by:
        doLockShared in class NamedLockSupport
        Throws:
        java.lang.InterruptedException
      • doLockExclusively

        protected boolean doLockExclusively​(long time,
                                            java.util.concurrent.TimeUnit unit)
                                     throws java.lang.InterruptedException
        Specified by:
        doLockExclusively in class NamedLockSupport
        Throws:
        java.lang.InterruptedException