Class DefaultDistributedLock
java.lang.Object
org.apache.shardingsphere.mode.repository.cluster.lock.impl.DefaultDistributedLock
- All Implemented Interfaces:
DistributedLock
Default distributed lock.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDistributedLock(String lockKey, ClusterPersistRepository client, DefaultLockTypedProperties props) -
Method Summary
-
Constructor Details
-
DefaultDistributedLock
public DefaultDistributedLock(String lockKey, ClusterPersistRepository client, DefaultLockTypedProperties props)
-
-
Method Details
-
tryLock
public boolean tryLock(long timeoutMillis) Description copied from interface:DistributedLockTry lock.- Specified by:
tryLockin interfaceDistributedLock- Parameters:
timeoutMillis- timeout millis- Returns:
- is locked or not
-
unlock
public void unlock()Description copied from interface:DistributedLockUnlock.- Specified by:
unlockin interfaceDistributedLock
-