diff --git a/.classpath b/.classpath
index bbf9837aa..a316b6684 100644
--- a/.classpath
+++ b/.classpath
@@ -12,7 +12,6 @@
-
@@ -20,8 +19,9 @@
-
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index b69a99a38..9377866ca 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,5 @@
#
-#Fri Mar 30 10:10:50 EEST 2012
+#Sun Apr 01 10:03:27 EEST 2012
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
diff --git a/gradle.properties b/gradle.properties
index 9faebb341..07999da81 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -16,7 +16,7 @@ mockitoVersion = 1.8.5
jedisVersion = 2.0.0
jredisVersion = 03122010
rjcVersion = 0.6.4
-sredisVersion = 0.1
+sredisVersion = 0.2-SNAPSHOT
# Manifest properties
diff --git a/src/main/java/org/springframework/data/redis/connection/sredis/SRedisConnection.java b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java
similarity index 77%
rename from src/main/java/org/springframework/data/redis/connection/sredis/SRedisConnection.java
rename to src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java
index dace9c2ce..bd07a475d 100644
--- a/src/main/java/org/springframework/data/redis/connection/sredis/SRedisConnection.java
+++ b/src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.springframework.data.redis.connection.sredis;
+package org.springframework.data.redis.connection.srp;
import java.io.IOException;
import java.util.Collections;
@@ -21,6 +21,7 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import java.util.concurrent.BlockingQueue;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.RedisConnectionFailureException;
@@ -35,27 +36,28 @@ import org.springframework.data.redis.connection.Subscription;
import redis.client.RedisClient;
import redis.client.RedisClient.Pipeline;
import redis.client.RedisException;
-import redis.client.SocketPool;
-import redis.reply.MultiBulkReply;
-import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.base.Charsets;
/**
* {@code RedisConnection} implementation on top of spullara Redis Protocol library.
*
* @author Costin Leau
*/
-public class SRedisConnection implements RedisConnection {
+public class SrpConnection implements RedisConnection {
+
+ private final RedisClient client;
+ private final BlockingQueue queue;
private boolean isClosed = false;
private boolean isMulti = false;
- private final RedisClient client;
private Pipeline pipeline;
- private volatile SRedisSubscription subscription;
+ private volatile SrpSubscription subscription;
- public SRedisConnection(SocketPool pool) {
+ public SrpConnection(String host, int port, BlockingQueue queue) {
try {
- this.client = new RedisClient(pool);
+ this.client = new RedisClient(host, port);
+ this.queue = queue;
} catch (IOException e) {
throw new RedisConnectionFailureException("Could not connect", e);
}
@@ -63,7 +65,7 @@ public class SRedisConnection implements RedisConnection {
protected DataAccessException convertSRAccessException(Exception ex) {
if (ex instanceof RedisException) {
- return SRedisUtils.convertSRedisAccessException((RedisException) ex);
+ return SrpUtils.convertSRedisAccessException((RedisException) ex);
}
if (ex instanceof IOException) {
return new RedisConnectionFailureException("Redis connection failed", (IOException) ex);
@@ -75,6 +77,7 @@ public class SRedisConnection implements RedisConnection {
public void close() throws DataAccessException {
isClosed = true;
+ queue.remove(this);
try {
client.close();
@@ -108,31 +111,32 @@ public class SRedisConnection implements RedisConnection {
}
public List