refactoring

pull/970/merge
Nikita Koksharov 5 years ago
parent 34a913616c
commit f97b073966

@ -83,7 +83,7 @@ public class RedissonSortedSet<V> extends RedissonObject implements RSortedSet<V
comparatorHolder = redisson.getBucket(getComparatorKeyName(), StringCodec.INSTANCE);
lock = redisson.getLock("redisson_sortedset_lock:{" + getName() + "}");
list = (RedissonList<V>) redisson.getList(getName());
list = (RedissonList<V>) redisson.<V>getList(getName());
}
public RedissonSortedSet(Codec codec, CommandExecutor commandExecutor, String name, Redisson redisson) {
@ -92,7 +92,7 @@ public class RedissonSortedSet<V> extends RedissonObject implements RSortedSet<V
comparatorHolder = redisson.getBucket(getComparatorKeyName(), StringCodec.INSTANCE);
lock = redisson.getLock("redisson_sortedset_lock:{" + getName() + "}");
list = (RedissonList<V>) redisson.getList(getName(), codec);
list = (RedissonList<V>) redisson.<V>getList(getName(), codec);
}
@Override

@ -16,17 +16,11 @@
package org.redisson.reactive;
import org.reactivestreams.Publisher;
import org.redisson.RedissonObject;
import org.redisson.RedissonSet;
import org.redisson.api.RFuture;
import org.redisson.api.RLockReactive;
import org.redisson.api.RPermitExpirableSemaphoreReactive;
import org.redisson.api.RReadWriteLockReactive;
import org.redisson.api.RSemaphoreReactive;
import org.redisson.api.RSet;
import org.redisson.api.RedissonReactiveClient;
import org.redisson.api.*;
import org.redisson.client.RedisClient;
import org.redisson.client.protocol.decoder.ListScanResult;
import reactor.core.publisher.Flux;
/**
@ -77,27 +71,27 @@ public class RedissonSetReactive<V> {
}
public RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(V value) {
String name = ((RedissonSet<V>) instance).getLockByValue(value, "permitexpirablesemaphore");
String name = ((RedissonObject) instance).getLockByValue(value, "permitexpirablesemaphore");
return redisson.getPermitExpirableSemaphore(name);
}
public RSemaphoreReactive getSemaphore(V value) {
String name = ((RedissonSet<V>) instance).getLockByValue(value, "semaphore");
String name = ((RedissonObject) instance).getLockByValue(value, "semaphore");
return redisson.getSemaphore(name);
}
public RLockReactive getFairLock(V value) {
String name = ((RedissonSet<V>) instance).getLockByValue(value, "fairlock");
String name = ((RedissonObject) instance).getLockByValue(value, "fairlock");
return redisson.getFairLock(name);
}
public RReadWriteLockReactive getReadWriteLock(V value) {
String name = ((RedissonSet<V>) instance).getLockByValue(value, "rw_lock");
String name = ((RedissonObject) instance).getLockByValue(value, "rw_lock");
return redisson.getReadWriteLock(name);
}
public RLockReactive getLock(V value) {
String name = ((RedissonSet<V>) instance).getLockByValue(value, "lock");
String name = ((RedissonObject) instance).getLockByValue(value, "lock");
return redisson.getLock(name);
}

@ -15,21 +15,14 @@
*/
package org.redisson.rx;
import io.reactivex.Single;
import org.reactivestreams.Publisher;
import org.redisson.RedissonSetCache;
import org.redisson.RedissonObject;
import org.redisson.ScanIterator;
import org.redisson.api.RFuture;
import org.redisson.api.RLockRx;
import org.redisson.api.RPermitExpirableSemaphoreRx;
import org.redisson.api.RReadWriteLockRx;
import org.redisson.api.RSemaphoreRx;
import org.redisson.api.RSetCache;
import org.redisson.api.RedissonRxClient;
import org.redisson.api.*;
import org.redisson.client.RedisClient;
import org.redisson.client.protocol.decoder.ListScanResult;
import io.reactivex.Single;
/**
*
* @author Nikita Koksharov
@ -65,27 +58,27 @@ public class RedissonSetCacheRx<V> {
}
public RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(V value) {
String name = ((RedissonSetCache<V>) instance).getLockByValue(value, "permitexpirablesemaphore");
String name = ((RedissonObject) instance).getLockByValue(value, "permitexpirablesemaphore");
return redisson.getPermitExpirableSemaphore(name);
}
public RSemaphoreRx getSemaphore(V value) {
String name = ((RedissonSetCache<V>) instance).getLockByValue(value, "semaphore");
String name = ((RedissonObject) instance).getLockByValue(value, "semaphore");
return redisson.getSemaphore(name);
}
public RLockRx getFairLock(V value) {
String name = ((RedissonSetCache<V>) instance).getLockByValue(value, "fairlock");
String name = ((RedissonObject) instance).getLockByValue(value, "fairlock");
return redisson.getFairLock(name);
}
public RReadWriteLockRx getReadWriteLock(V value) {
String name = ((RedissonSetCache<V>) instance).getLockByValue(value, "rw_lock");
String name = ((RedissonObject) instance).getLockByValue(value, "rw_lock");
return redisson.getReadWriteLock(name);
}
public RLockRx getLock(V value) {
String name = ((RedissonSetCache<V>) instance).getLockByValue(value, "lock");
String name = ((RedissonObject) instance).getLockByValue(value, "lock");
return redisson.getLock(name);
}

Loading…
Cancel
Save