public class RedisTemplateSyncLock extends AbstractSyncLock
| 构造器和说明 |
|---|
RedisTemplateSyncLock() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
doTryLock(String key,
String requestId,
int maxHoldSeconds)
上锁
|
protected void |
doUnLock(String key,
String requestId)
解锁
|
org.springframework.data.redis.core.StringRedisTemplate |
getRedisTemplate() |
void |
setRedisTemplate(org.springframework.data.redis.core.StringRedisTemplate redisTemplate) |
getKeyPrefix, getLockKey, getMaxHoldSeconds, getMaxWaitSeconds, getNodeId, getRequestId, getRetryInterval, lock, lock, lock, lock, lock, lock, release, release, run, run, run, run, run, run, setKeyPrefix, setMaxHoldSeconds, setMaxWaitSeconds, setNodeId, setRetryInterval, with, with, with, with, with, withprotected boolean doTryLock(String key, String requestId, int maxHoldSeconds)
doTryLock 在类中 AbstractSyncLockkey - Redis KeyrequestId - Redis ValuemaxHoldSeconds - Redis Expire Timeprotected void doUnLock(String key, String requestId)
AbstractSyncLockdoUnLock 在类中 AbstractSyncLockkey - 业务建requestId - 请求标识public org.springframework.data.redis.core.StringRedisTemplate getRedisTemplate()
public void setRedisTemplate(org.springframework.data.redis.core.StringRedisTemplate redisTemplate)
Copyright © 2024. All rights reserved.