Package org.eclipse.aether.named.support
Class CompositeNamedLock
- java.lang.Object
-
- org.eclipse.aether.named.support.NamedLockSupport
-
- org.eclipse.aether.named.support.CompositeNamedLock
-
- All Implemented Interfaces:
java.lang.AutoCloseable,NamedLock
public final class CompositeNamedLock extends NamedLockSupport
Implementation of composite lock when "composition" is needed for locks that are naturally mapped as 1:1 name vs some backing implementation. Instances of these locks are "unique per call" and are not ref counted.- Since:
- 2.0.0
-
-
Field Summary
-
Fields inherited from class org.eclipse.aether.named.support.NamedLockSupport
logger
-
-
Constructor Summary
Constructors Constructor Description CompositeNamedLock(NamedLockKey key, NamedLockFactorySupport factory, java.util.Collection<NamedLock> namedLocks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoClose()protected booleandoLockExclusively(long time, java.util.concurrent.TimeUnit unit)protected booleandoLockShared(long time, java.util.concurrent.TimeUnit unit)protected voiddoUnlock()-
Methods inherited from class org.eclipse.aether.named.support.NamedLockSupport
close, diagnosticState, key, lockExclusively, lockShared, toString, unlock
-
-
-
-
Constructor Detail
-
CompositeNamedLock
public CompositeNamedLock(NamedLockKey key, NamedLockFactorySupport factory, java.util.Collection<NamedLock> namedLocks)
-
-
Method Detail
-
doLockShared
protected boolean doLockShared(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
doLockSharedin classNamedLockSupport- Throws:
java.lang.InterruptedException
-
doLockExclusively
protected boolean doLockExclusively(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
doLockExclusivelyin classNamedLockSupport- Throws:
java.lang.InterruptedException
-
doUnlock
protected void doUnlock()
- Specified by:
doUnlockin classNamedLockSupport
-
doClose
protected void doClose()
- Overrides:
doClosein classNamedLockSupport
-
-