Comments added

pull/395/head
Nikita 9 years ago
parent ef7538843a
commit 6cdc12d317

@ -231,14 +231,6 @@ public class Config {
return this.sentinelServersConfig;
}
/**
* Deprecated. Use {@link #useSentinelServers()} instead
*/
@Deprecated
public SentinelServersConfig useSentinelConnection() {
return useSentinelServers();
}
SentinelServersConfig getSentinelServersConfig() {
return sentinelServersConfig;
}
@ -272,13 +264,6 @@ public class Config {
return masterSlaveServersConfig;
}
/**
* Deprecated. Use {@link #useMasterSlaveServers()} instead
*/
@Deprecated
public MasterSlaveServersConfig useMasterSlaveConnection() {
return useMasterSlaveServers();
}
MasterSlaveServersConfig getMasterSlaveServersConfig() {
return masterSlaveServersConfig;
}
@ -346,8 +331,11 @@ public class Config {
}
/**
* Use defined eventLoopGroup instance.
* Thus several Redisson instances can use one eventLoopGroup instance.
* Use external EventLoopGroup. EventLoopGroup processes all
* Netty connection tied with Redis servers. Each EventLoopGroup creates
* own threads and each Redisson client creates own EventLoopGroup by default.
* So if there are multiple Redisson instances in same JVM
* it would be useful to share one EventLoopGroup among them.
* <p/>
* Only {@link io.netty.channel.epoll.EpollEventLoopGroup} or
* {@link io.netty.channel.nio.NioEventLoopGroup} can be used.

@ -124,6 +124,6 @@ public interface RLock extends Lock, RExpirable {
Future<Boolean> tryLockAsync(long waitTime, TimeUnit unit);
Future<Boolean> tryLockAsync(final long waitTime, final long leaseTime, final TimeUnit unit);
Future<Boolean> tryLockAsync(long waitTime, long leaseTime, TimeUnit unit);
}

@ -34,12 +34,27 @@ import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.Promise;
import io.netty.util.internal.PlatformDependent;
/**
* Guarantees multiple locks operation handling (lock, tryLock...)
* in atomic way without deadlocks.
*
* @author Nikita Koksharov
*
*/
public class RedissonMultiLock implements Lock {
final List<RLock> locks = new ArrayList<RLock>();
/**
* Creates instance with multiple {@link RLock} objects.
* Each RLock object could be created by own Redisson instance.
*
* @param locks
*/
public RedissonMultiLock(RLock... locks) {
super();
if (locks.length == 0) {
throw new IllegalArgumentException("Lock objects are not defined");
}
this.locks.addAll(Arrays.asList(locks));
}

Loading…
Cancel
Save