Package com.github.ddth.dlock.impl.redis
Class RedisDLockFactory
- java.lang.Object
-
- com.github.ddth.dlock.impl.AbstractDLockFactory
-
- com.github.ddth.dlock.impl.redis.BaseRedisDLockFactory
-
- com.github.ddth.dlock.impl.redis.RedisDLockFactory
-
- All Implemented Interfaces:
IDLockFactory,AutoCloseable
public class RedisDLockFactory 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 RedisDLockFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.github.ddth.commons.redis.JedisConnectorbuildJedisConnector()RedisDLockcreateLock(String name)Create a new lock.protected RedisDLockcreateLockInternal(String name, Properties lockProps)Create a new lock instance, but does not initialize it.StringgetRedisHostAndPort()Redis' host and port scheme (formathost:port).RedisDLockFactorysetRedisHostAndPort(String redisHostAndPort)Redis' host and port scheme (formathost:port).-
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
-
getRedisHostAndPort
public String getRedisHostAndPort()
Redis' host and port scheme (formathost:port).- Returns:
-
setRedisHostAndPort
public RedisDLockFactory setRedisHostAndPort(String redisHostAndPort)
Redis' host and port scheme (formathost:port).- Parameters:
redisHostAndPort-- Returns:
-
buildJedisConnector
protected com.github.ddth.commons.redis.JedisConnector buildJedisConnector()
- Specified by:
buildJedisConnectorin classBaseRedisDLockFactory- Returns:
- Since:
- 0.1.1.2
-
createLock
public RedisDLock createLock(String name)
Create a new lock.- Specified by:
createLockin interfaceIDLockFactory- Overrides:
createLockin classBaseRedisDLockFactory- Returns:
- Since:
- 0.1.2
-
createLockInternal
protected RedisDLock 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:
-
-