Browse files

generic name MarshalTranscoder and MarshalZlibTranscoder

  • Loading branch information...
1 parent 30fb4a4 commit d803767631b2d22fb7fb5d68b2d8b6c79fb2eb23 @flyerhzm flyerhzm committed Jul 30, 2012
View
8 ...openfeint/memcached/SimpleTranscoder.java → ...penfeint/memcached/MarshalTranscoder.java
@@ -12,18 +12,18 @@
/**
*
- * SimpleTranscoder do marshaling and unmarshaling.
+ * MarshalTranscoder does marshaling and unmarshaling.
*
*/
-public class SimpleTranscoder implements Transcoder<IRubyObject> {
+public class MarshalTranscoder implements Transcoder<IRubyObject> {
private Ruby ruby;
private int flags;
- public SimpleTranscoder(Ruby ruby) {
+ public MarshalTranscoder(Ruby ruby) {
this(ruby, 0);
}
- public SimpleTranscoder(Ruby ruby, int flags) {
+ public MarshalTranscoder(Ruby ruby, int flags) {
this.ruby = ruby;
this.flags = flags;
}
View
9 ...nfeint/memcached/OpenfeintTranscoder.java → ...eint/memcached/MarshalZlibTranscoder.java
@@ -18,18 +18,18 @@
/**
*
- * OpenfeintTranscoder do marshaling/unmarshaling and compressing/decompressing with zlib.
+ * MarshalZlibTranscoder do marshaling/unmarshaling and compressing/decompressing with zlib.
*
*/
-public class OpenfeintTranscoder implements Transcoder<IRubyObject> {
+public class MarshalZlibTranscoder implements Transcoder<IRubyObject> {
private Ruby ruby;
private int flags;
- public OpenfeintTranscoder(Ruby ruby) {
+ public MarshalZlibTranscoder(Ruby ruby) {
this(ruby, 1);
}
- public OpenfeintTranscoder(Ruby ruby, int flags) {
+ public MarshalZlibTranscoder(Ruby ruby, int flags) {
this.ruby = ruby;
this.flags = flags;
}
@@ -57,7 +57,6 @@ public CachedData encode(IRubyObject o) {
return new CachedData(getFlags(), bytes, bytes.length);
} catch (IOException ioe) {
- System.out.println("io exception: " + ioe.getMessage());
throw ruby.newIOErrorFromException(ioe);
}
}
View
6 src/main/java/com/openfeint/memcached/Memcached.java
@@ -124,10 +124,10 @@ public IRubyObject initialize(ThreadContext context, IRubyObject servers, IRubyO
client = new MemcachedClient(builder.build(), addresses);
- if ("openfeint".equals(transcoderValue)) {
- transcoder = new OpenfeintTranscoder(ruby);
+ if ("marshal_zlib".equals(transcoderValue)) {
+ transcoder = new MarshalZlibTranscoder(ruby);
} else {
- transcoder = new SimpleTranscoder(ruby);
+ transcoder = new MarshalTranscoder(ruby);
}
} catch (IOException ioe) {
throw context.runtime.newIOErrorFromException(ioe);
View
BIN target/spymemcached-ext-0.0.1.jar
Binary file not shown.

0 comments on commit d803767

Please sign in to comment.