public class SemaphoreKeeperGuavaImpl<K> extends Object implements SemaphoreKeeper<K>
| Constructor and Description |
|---|
SemaphoreKeeperGuavaImpl(int permits,
boolean fair) |
| Modifier and Type | Method and Description |
|---|---|
void |
releaseGuard(Semaphore guard)
Unlock and release guard.
|
Semaphore |
summonGuard(K key)
Create or load semaphore for key from cache.
|
Semaphore |
summonGuardAndAcquire(K key)
Get guard and lock for key.
|
public SemaphoreKeeperGuavaImpl(int permits,
boolean fair)
public Semaphore summonGuard(@Nonnull K key)
SemaphoreKeepersummonGuard in interface SemaphoreKeeper<K>key - semaphore identifierpublic Semaphore summonGuardAndAcquire(@Nonnull K key)
SemaphoreKeepersummonGuardAndAcquire in interface SemaphoreKeeper<K>key - for which guard should be created and acquiredpublic void releaseGuard(@Nullable Semaphore guard)
SemaphoreKeeperreleaseGuard in interface SemaphoreKeeper<K>guard - semaphore guard which should be releasedCopyright © 2019 OpenDaylight. All rights reserved.