Package com.github.ddth.dlock.impl.redis
Class ClusteredRedisDLockFactory
- java.lang.Object
-
- com.github.ddth.dlock.impl.AbstractDLockFactory
-
- com.github.ddth.dlock.impl.redis.BaseRedisDLockFactory
-
- com.github.ddth.dlock.impl.redis.ClusteredRedisDLockFactory
-
- All Implemented Interfaces:
IDLockFactory,AutoCloseable
public class ClusteredRedisDLockFactory extends BaseRedisDLockFactory
- Since:
- 0.1.0
- Author:
- Thanh Ba Nguyen
-
-
Field Summary
-
Fields inherited from class com.github.ddth.dlock.impl.redis.BaseRedisDLockFactory
myOwnRedis
-
-
Constructor Summary
Constructors Constructor Description ClusteredRedisDLockFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.github.ddth.commons.redis.JedisConnectorbuildJedisConnector()ClusteredRedisDLockcreateLock(String name)Create a new lock.protected ClusteredRedisDLockcreateLockInternal(String name, Properties lockProps)Create a new lock instance, but does not initialize it.StringgetRedisHostsAndPorts()Redis' hosts and ports scheme (formathost1:port1,host2:port2,host3:port3).ClusteredRedisDLockFactorysetRedisHostsAndPorts(String redisHostsAndPorts)Redis' hosts and ports scheme (formathost1:port1,host2:port2,host3:port3).-
Methods inherited from class com.github.ddth.dlock.impl.redis.BaseRedisDLockFactory
destroy, getJedisConnector, getRedisPassword, init, setJedisConnector, setRedisPassword
-
Methods inherited from class com.github.ddth.dlock.impl.AbstractDLockFactory
buildLockName, close, createAndInitLockInstance, getLockNamePrefix, getLockProperties, getLockPropertiesMap, setLockNamePrefix, setLockProperties
-
-
-
-
Method Detail
-
getRedisHostsAndPorts
public String getRedisHostsAndPorts()
Redis' hosts and ports scheme (formathost1:port1,host2:port2,host3:port3).- Returns:
-
setRedisHostsAndPorts
public ClusteredRedisDLockFactory setRedisHostsAndPorts(String redisHostsAndPorts)
Redis' hosts and ports scheme (formathost1:port1,host2:port2,host3:port3).- Parameters:
redisHostsAndPorts-- Returns:
-
buildJedisConnector
protected com.github.ddth.commons.redis.JedisConnector buildJedisConnector()
- Specified by:
buildJedisConnectorin classBaseRedisDLockFactory- Returns:
- Since:
- 0.1.1.2
-
createLock
public ClusteredRedisDLock createLock(String name)
Create a new lock.- Specified by:
createLockin interfaceIDLockFactory- Overrides:
createLockin classBaseRedisDLockFactory- Returns:
- Since:
- 0.1.2
-
createLockInternal
protected ClusteredRedisDLock createLockInternal(String name, Properties lockProps)
Create a new lock instance, but does not initialize it. Convenient method for sub-class to override.- Specified by:
createLockInternalin classAbstractDLockFactory- Returns:
-
-