public class RedisDistributedLock extends Object
| 构造器和说明 |
|---|
RedisDistributedLock(Locker locker)
Constructs a new redis distributed lock with a locker
|
| 限定符和类型 | 方法和说明 |
|---|---|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key)
Execute the distributed task
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
DistributedRollBack rollBack)
Execute the distributed task, and asynchronous execution the roll back
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
DistributedRollBack rollBack,
boolean isAsync)
Execute the distributed task, and asynchronous execution the roll back
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount)
Execute the distributed task
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
DistributedRollBack rollBack)
Execute the distributed task, and asynchronous execution the roll back
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
DistributedRollBack rollBack,
boolean isAsync)
Execute the distributed task
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
long expireTime)
Execute the distributed task
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
long expireTime,
DistributedRollBack rollBack)
Execute the distributed task, and asynchronous execution the roll back
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
long expireTime,
DistributedRollBack rollBack,
boolean isAsync)
Execute the distributed task
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
long delayTime,
long expireTime,
DistributedRollBack rollBack)
Execute the distributed task, and asynchronous execution the roll back
|
<R> DistributedTaskResult<R> |
execute(DistributedTask<R> task,
String key,
int retryCount,
long delayTime,
long expireTime,
DistributedRollBack rollBack,
boolean isAsync)
Execute the distributed task
|
void |
setDefaultDelayTime(long delayTime)
Set default delay time of the get lock(millisecond)
|
void |
setDefaultExpireTime(long expireTime)
Set default expire time of the lock(millisecond)
|
void |
setDefaultRetryCount(int retryCount)
Set default retry count of the get lock(millisecond)
|
public RedisDistributedLock(Locker locker)
locker - the lockerpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key)
R - the task result data typetask - the distributed taskkey - the resource keypublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, DistributedRollBack rollBack)
R - the task result data typetask - the distributed taskkey - the resource keyrollBack - the distributed task roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, DistributedRollBack rollBack, boolean isAsync)
R - the task result data typetask - the distributed taskkey - the resource keyrollBack - the distributed task roll backisAsync - whether or not asynchronous execution the roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, long expireTime)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockexpireTime - the expired time of get lockpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, DistributedRollBack rollBack)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockrollBack - the distributed task roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, DistributedRollBack rollBack, boolean isAsync)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockrollBack - the distributed task roll backisAsync - whether or not asynchronous execution the roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, long expireTime, DistributedRollBack rollBack)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockexpireTime - the expired time of get lockrollBack - the distributed task roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, long expireTime, DistributedRollBack rollBack, boolean isAsync)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockexpireTime - the expired time of get lockrollBack - the distributed task roll backisAsync - whether or not asynchronous execution the roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, long delayTime, long expireTime, DistributedRollBack rollBack)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockdelayTime - the delay time of get lockexpireTime - the expired time of get lockrollBack - the distributed task roll backpublic <R> DistributedTaskResult<R> execute(DistributedTask<R> task, String key, int retryCount, long delayTime, long expireTime, DistributedRollBack rollBack, boolean isAsync)
R - the task result data typetask - the distributed taskkey - the resource keyretryCount - the retry count of get lockdelayTime - the delay time of get lockexpireTime - the expired time of get lockrollBack - the distributed task roll backisAsync - whether or not asynchronous execution the roll backpublic void setDefaultRetryCount(int retryCount)
retryCount - the retry countpublic void setDefaultExpireTime(long expireTime)
expireTime - the expire timepublic void setDefaultDelayTime(long delayTime)
delayTime - the delay timeCopyright © 2019. All rights reserved.