public class LockService<L extends Lock> extends Object implements ILockService<L>
| 限定符和类型 | 字段和说明 |
|---|---|
LockTemplate<L> |
lockTemplate |
| 构造器和说明 |
|---|
LockService() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
execute(Runnable runnable,
long waitTime,
long leaseTime,
String... key) |
void |
execute(Runnable runnable,
long waitTime,
String... key) |
<R> R |
execute(Runnable runnable,
R result,
long waitTime,
long leaseTime,
String... key) |
<R> R |
execute(Runnable runnable,
R result,
long waitTime,
String... key) |
<R> R |
execute(Runnable runnable,
R result,
String... key) |
void |
execute(Runnable runnable,
String... key) |
L |
getLock(String... key) |
LockTemplate<L> |
getLockTemplate() |
void |
lock(L lock) |
<T> Future<T> |
submit(Runnable runnable,
T result,
long waitTime,
long leaseTime,
String... key) |
<T> Future<T> |
submit(Runnable runnable,
T result,
long waitTime,
String... key) |
<T> Future<T> |
submit(Runnable runnable,
T result,
String... key) |
boolean |
tryLock(L lock) |
boolean |
tryLock(L lock,
long waitTime) |
boolean |
tryLock(L lock,
long waitTime,
long leaseTime) |
void |
unlock(L lock) |
@Autowired(required=false) public LockTemplate<L extends Lock> lockTemplate
public LockTemplate<L> getLockTemplate()
public void lock(L lock)
lock 在接口中 ILockService<L extends Lock>public boolean tryLock(L lock)
tryLock 在接口中 ILockService<L extends Lock>public boolean tryLock(L lock, long waitTime) throws Exception
tryLock 在接口中 ILockService<L extends Lock>Exceptionpublic boolean tryLock(L lock, long waitTime, long leaseTime) throws Exception
tryLock 在接口中 ILockService<L extends Lock>Exceptionpublic void unlock(L lock)
unlock 在接口中 ILockService<L extends Lock>public void execute(Runnable runnable, String... key) throws Exception
execute 在接口中 ILockService<L extends Lock>Exceptionpublic void execute(Runnable runnable, long waitTime, String... key) throws Exception
execute 在接口中 ILockService<L extends Lock>Exceptionpublic void execute(Runnable runnable, long waitTime, long leaseTime, String... key) throws Exception
execute 在接口中 ILockService<L extends Lock>Exceptionpublic <R> R execute(Runnable runnable, R result, String... key) throws Exception
execute 在接口中 ILockService<L extends Lock>Exceptionpublic <R> R execute(Runnable runnable, R result, long waitTime, String... key) throws Exception
execute 在接口中 ILockService<L extends Lock>Exceptionpublic <R> R execute(Runnable runnable, R result, long waitTime, long leaseTime, String... key) throws Exception
execute 在接口中 ILockService<L extends Lock>Exceptionpublic <T> Future<T> submit(Runnable runnable, T result, String... key) throws Exception
submit 在接口中 ILockService<L extends Lock>Exceptionpublic <T> Future<T> submit(Runnable runnable, T result, long waitTime, String... key) throws Exception
submit 在接口中 ILockService<L extends Lock>ExceptionCopyright © 2023. All rights reserved.