Constructors visibility changed to protected. #71

pull/99/head
Nikita 10 years ago
parent babc2f0177
commit 25698103c8

@ -33,7 +33,7 @@ import com.lambdaworks.redis.RedisConnection;
*/
public class RedissonAtomicLong extends RedissonExpirable implements RAtomicLong {
RedissonAtomicLong(ConnectionManager connectionManager, String name) {
protected RedissonAtomicLong(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
init();

@ -28,7 +28,7 @@ import com.lambdaworks.redis.RedisAsyncConnection;
public class RedissonBucket<V> extends RedissonExpirable implements RBucket<V> {
RedissonBucket(ConnectionManager connectionManager, String name) {
protected RedissonBucket(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}

@ -52,7 +52,7 @@ public class RedissonCountDownLatch extends RedissonObject implements RCountDown
private final UUID id;
RedissonCountDownLatch(ConnectionManager connectionManager, String name, UUID id) {
protected RedissonCountDownLatch(ConnectionManager connectionManager, String name, UUID id) {
super(connectionManager, name);
this.id = id;
}

@ -37,7 +37,7 @@ import com.lambdaworks.redis.RedisAsyncConnection;
*/
public class RedissonDeque<V> extends RedissonQueue<V> implements RDeque<V> {
RedissonDeque(ConnectionManager connectionManager, String name) {
protected RedissonDeque(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}

@ -27,7 +27,7 @@ import com.lambdaworks.redis.RedisAsyncConnection;
public class RedissonHyperLogLog<V> extends RedissonObject implements RHyperLogLog<V> {
RedissonHyperLogLog(ConnectionManager connectionManager, String name) {
protected RedissonHyperLogLog(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}

@ -44,7 +44,7 @@ public class RedissonList<V> extends RedissonExpirable implements RList<V> {
private int batchSize = 50;
RedissonList(ConnectionManager connectionManager, String name) {
protected RedissonList(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}
@ -183,7 +183,7 @@ public class RedissonList<V> extends RedissonExpirable implements RList<V> {
}
return result;
}
});
}
@ -245,14 +245,14 @@ public class RedissonList<V> extends RedissonExpirable implements RList<V> {
@Override
public V set(final int index, final V element) {
checkIndex(index);
return connectionManager.write(new SyncOperation<V, V>() {
@Override
public V execute(RedisConnection<Object, V> conn) {
while (true) {
conn.watch(getName());
V prev = (V) conn.lindex(getName(), index);
conn.multi();
conn.lset(getName(), index, element);
if (conn.exec().size() == 1) {
@ -293,7 +293,7 @@ public class RedissonList<V> extends RedissonExpirable implements RList<V> {
conn.watch(getName());
V prev = (V) conn.lindex(getName(), index);
List<Object> tail = conn.lrange(getName(), index + 1, size());
conn.multi();
conn.ltrim(getName(), 0, index - 1);
conn.rpush(getName(), tail.toArray());

@ -113,7 +113,7 @@ public class RedissonLock extends RedissonObject implements RLock {
private static final ConcurrentMap<String, RedissonLockEntry> ENTRIES = new ConcurrentHashMap<String, RedissonLockEntry>();
RedissonLock(ConnectionManager connectionManager, String name, UUID id) {
protected RedissonLock(ConnectionManager connectionManager, String name, UUID id) {
super(connectionManager, name);
this.id = id;
}
@ -131,6 +131,7 @@ public class RedissonLock extends RedissonObject implements RLock {
if (newEntry.isFree()
&& ENTRIES.remove(getEntryName(), newEntry)) {
synchronized (ENTRIES) {
// maybe added during subscription
if (!ENTRIES.containsKey(getEntryName())) {
connectionManager.unsubscribe(getChannelName());
}

@ -51,7 +51,7 @@ import com.lambdaworks.redis.output.MapScanResult;
//TODO implement watching by keys instead of map name
public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
RedissonMap(ConnectionManager connectionManager, String name) {
protected RedissonMap(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}

@ -34,7 +34,7 @@ import com.lambdaworks.redis.RedisAsyncConnection;
*/
public class RedissonQueue<V> extends RedissonList<V> implements RQueue<V> {
RedissonQueue(ConnectionManager connectionManager, String name) {
protected RedissonQueue(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}

@ -41,7 +41,7 @@ import com.lambdaworks.redis.output.ListScanResult;
*/
public class RedissonSet<V> extends RedissonExpirable implements RSet<V> {
RedissonSet(ConnectionManager connectionManager, String name) {
protected RedissonSet(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}
@ -78,14 +78,14 @@ public class RedissonSet<V> extends RedissonExpirable implements RSet<V> {
}
});
}
@Override
public Iterator<V> iterator() {
return new Iterator<V>() {
private Iterator<V> iter;
private Long iterPos;
private boolean removeExecuted;
private V value;
@ -156,7 +156,7 @@ public class RedissonSet<V> extends RedissonExpirable implements RSet<V> {
public boolean add(final V e) {
return connectionManager.get(addAsync(e));
}
@Override
public Future<Boolean> addAsync(final V e) {
return connectionManager.writeAsync(new AsyncOperation<V, Boolean>() {

@ -92,7 +92,7 @@ public class RedissonSortedSet<V> extends RedissonObject implements RSortedSet<V
private Comparator<? super V> comparator = NaturalComparator.NATURAL_ORDER;
RedissonSortedSet(ConnectionManager connectionManager, String name) {
protected RedissonSortedSet(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
loadComparator();

@ -34,7 +34,7 @@ import com.lambdaworks.redis.RedisAsyncConnection;
*/
public class RedissonTopic<M> extends RedissonObject implements RTopic<M> {
RedissonTopic(ConnectionManager connectionManager, String name) {
protected RedissonTopic(ConnectionManager connectionManager, String name) {
super(connectionManager, name);
}

Loading…
Cancel
Save