Class SemaphoreKeeperGuavaImpl<K>
- java.lang.Object
 - 
- org.opendaylight.openflowplugin.applications.frsync.util.SemaphoreKeeperGuavaImpl<K>
 
 
- 
- All Implemented Interfaces:
 SemaphoreKeeper<K>
public class SemaphoreKeeperGuavaImpl<K> extends Object implements SemaphoreKeeper<K>
 
- 
- 
Constructor Summary
Constructors Constructor Description SemaphoreKeeperGuavaImpl(int permits, boolean fair) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreleaseGuard(@Nullable Semaphore guard)Unlock and release guard.SemaphoresummonGuard(@NonNull K key)Create or load semaphore for key from cache.SemaphoresummonGuardAndAcquire(@NonNull K key)Get guard and lock for key. 
 - 
 
- 
- 
Method Detail
- 
summonGuard
public Semaphore summonGuard(@NonNull K key)
Description copied from interface:SemaphoreKeeperCreate or load semaphore for key from cache.- Specified by:
 summonGuardin interfaceSemaphoreKeeper<K>- Parameters:
 key- semaphore identifier- Returns:
 - new or existing semaphore for given key, for one key there is always only one semaphore available
 
 
- 
summonGuardAndAcquire
public Semaphore summonGuardAndAcquire(@NonNull K key)
Description copied from interface:SemaphoreKeeperGet guard and lock for key.- Specified by:
 summonGuardAndAcquirein interfaceSemaphoreKeeper<K>- Parameters:
 key- for which guard should be created and acquired- Returns:
 - semaphore guard
 
 
- 
releaseGuard
public void releaseGuard(@Nullable Semaphore guard)
Description copied from interface:SemaphoreKeeperUnlock and release guard.- Specified by:
 releaseGuardin interfaceSemaphoreKeeper<K>- Parameters:
 guard- semaphore guard which should be released
 
 - 
 
 -