Package org.eclipse.aether.named.support
Class ReadWriteLockNamedLock
java.lang.Object
org.eclipse.aether.named.support.NamedLockSupport
org.eclipse.aether.named.support.ReadWriteLockNamedLock
- All Implemented Interfaces:
AutoCloseable
,NamedLock
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 Summary
Fields inherited from class org.eclipse.aether.named.support.NamedLockSupport
logger
-
Constructor Summary
ConstructorDescriptionReadWriteLockNamedLock
(NamedLockKey key, NamedLockFactorySupport factory, ReadWriteLock readWriteLock) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doLockExclusively
(long time, TimeUnit unit) protected boolean
doLockShared
(long time, TimeUnit unit) protected void
doUnlock()
Methods inherited from class org.eclipse.aether.named.support.NamedLockSupport
close, diagnosticState, doClose, key, lockExclusively, lockShared, toString, unlock
-
Constructor Details
-
ReadWriteLockNamedLock
public ReadWriteLockNamedLock(NamedLockKey key, NamedLockFactorySupport factory, ReadWriteLock readWriteLock)
-
-
Method Details
-
doLockExclusively
- Specified by:
doLockExclusively
in classNamedLockSupport
- Throws:
InterruptedException
-
doUnlock
- Specified by:
doUnlock
in classNamedLockSupport