@Service public class DistributedLockManager extends Object implements org.onosproject.store.service.LockService
| Modifier and Type | Field and Description |
|---|---|
static int |
DEAD_LOCK_TIMEOUT_MS |
static String |
ONOS_LOCK_TABLE_NAME |
| Constructor and Description |
|---|
DistributedLockManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
addListener(org.onosproject.store.service.LockEventListener listener) |
org.onosproject.store.service.Lock |
create(String path) |
void |
deactivate() |
protected CompletableFuture<Void> |
lockIfAvailable(org.onosproject.store.service.Lock lock,
int leaseDurationMillis)
Attempts to acquire the lock as soon as it becomes available.
|
protected CompletableFuture<Void> |
lockIfAvailable(org.onosproject.store.service.Lock lock,
int waitTimeMillis,
int leaseDurationMillis)
Attempts to acquire the lock as soon as it becomes available.
|
void |
removeListener(org.onosproject.store.service.LockEventListener listener) |
public static final String ONOS_LOCK_TABLE_NAME
public static final int DEAD_LOCK_TIMEOUT_MS
@Activate public void activate()
@Deactivate public void deactivate()
public org.onosproject.store.service.Lock create(String path)
create in interface org.onosproject.store.service.LockServicepublic void addListener(org.onosproject.store.service.LockEventListener listener)
addListener in interface org.onosproject.store.service.LockServicepublic void removeListener(org.onosproject.store.service.LockEventListener listener)
removeListener in interface org.onosproject.store.service.LockServiceprotected CompletableFuture<Void> lockIfAvailable(org.onosproject.store.service.Lock lock, int waitTimeMillis, int leaseDurationMillis)
lock - lock to acquire.waitTimeMillis - maximum time to wait before giving up.leaseDurationMillis - the duration for which to acquire the lock initially.protected CompletableFuture<Void> lockIfAvailable(org.onosproject.store.service.Lock lock, int leaseDurationMillis)
lock - lock to acquire.leaseDurationMillis - the duration for which to acquire the lock initially.Copyright © 2014. All rights reserved.