public class DistributedLock extends Object implements org.onosproject.store.service.Lock
| Constructor and Description |
|---|
DistributedLock(String path,
org.onosproject.store.service.DatabaseService databaseService,
org.onosproject.cluster.ClusterService clusterService,
DistributedLockManager lockManager) |
| Modifier and Type | Method and Description |
|---|---|
long |
epoch() |
boolean |
extendExpiration(int leaseDurationMillis) |
boolean |
isLocked() |
void |
lock(int leaseDurationMillis) |
CompletableFuture<Void> |
lockAsync(int leaseDurationMillis) |
String |
path() |
boolean |
tryLock(int leaseDurationMillis) |
boolean |
tryLock(int waitTimeMillis,
int leaseDurationMillis) |
void |
unlock() |
public DistributedLock(String path, org.onosproject.store.service.DatabaseService databaseService, org.onosproject.cluster.ClusterService clusterService, DistributedLockManager lockManager)
public String path()
path in interface org.onosproject.store.service.Lockpublic void lock(int leaseDurationMillis)
throws InterruptedException
lock in interface org.onosproject.store.service.LockInterruptedExceptionpublic CompletableFuture<Void> lockAsync(int leaseDurationMillis)
lockAsync in interface org.onosproject.store.service.Lockpublic boolean tryLock(int leaseDurationMillis)
tryLock in interface org.onosproject.store.service.Lockpublic boolean tryLock(int waitTimeMillis,
int leaseDurationMillis)
throws InterruptedException
tryLock in interface org.onosproject.store.service.LockInterruptedExceptionpublic boolean isLocked()
isLocked in interface org.onosproject.store.service.Lockpublic long epoch()
epoch in interface org.onosproject.store.service.Lockpublic void unlock()
unlock in interface org.onosproject.store.service.Lockpublic boolean extendExpiration(int leaseDurationMillis)
extendExpiration in interface org.onosproject.store.service.LockCopyright © 2014. All rights reserved.