Package org.eclipse.aether.named.support
Class AdaptedSemaphoreNamedLock
- java.lang.Object
-
- org.eclipse.aether.named.support.NamedLockSupport
-
- org.eclipse.aether.named.support.AdaptedSemaphoreNamedLock
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,NamedLock
public class AdaptedSemaphoreNamedLock extends NamedLockSupport
Named lock support implementation that is using "adapted" semaphore (to be able to use semaphores not sharing common API).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AdaptedSemaphoreNamedLock.AdaptedSemaphore
Wrapper for semaphore-like stuff, that do not share common ancestor.
-
Field Summary
-
Fields inherited from class org.eclipse.aether.named.support.NamedLockSupport
logger
-
-
Constructor Summary
Constructors Constructor Description AdaptedSemaphoreNamedLock(java.lang.String name, NamedLockFactorySupport factory, AdaptedSemaphoreNamedLock.AdaptedSemaphore semaphore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doLockExclusively(long time, java.util.concurrent.TimeUnit unit)
protected boolean
doLockShared(long time, java.util.concurrent.TimeUnit unit)
protected void
doUnlock()
-
Methods inherited from class org.eclipse.aether.named.support.NamedLockSupport
close, diagnosticState, doClose, lockExclusively, lockShared, name, toString, unlock
-
-
-
-
Constructor Detail
-
AdaptedSemaphoreNamedLock
public AdaptedSemaphoreNamedLock(java.lang.String name, NamedLockFactorySupport factory, AdaptedSemaphoreNamedLock.AdaptedSemaphore semaphore)
-
-
Method Detail
-
doLockShared
protected boolean doLockShared(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
doLockShared
in classNamedLockSupport
- Throws:
java.lang.InterruptedException
-
doLockExclusively
protected boolean doLockExclusively(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
doLockExclusively
in classNamedLockSupport
- Throws:
java.lang.InterruptedException
-
doUnlock
protected void doUnlock()
- Specified by:
doUnlock
in classNamedLockSupport
-
-