public interface DistributedLock
void lock(String lockKey) throws InterruptedException
lockKey
- 锁键InterruptedException
void lock(String lockKey, long leaseTime, TimeUnit timeUnit) throws InterruptedException
lockKey
- 锁键leaseTime
- 持有时长timeUnit
- 时间单位InterruptedException
boolean tryLock(String lockKey, long waitTime, long leaseTime, TimeUnit timeUnit) throws InterruptedException
lockKey
- 锁键waitTime
- 等待时长leaseTime
- 持有时长timeUnit
- 时间单位InterruptedException
void unlock(String lockKey)
lockKey
- 锁键