jruby-memcached 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +0,0 @@
1
- class Memcached::Error < RuntimeError; end
2
- class Memcached::NotFound < Memcached::Error; end
3
- class Memcached::NotStored < Memcached::Error; end
4
- class Memcached::NotSupport < Memcached::Error; end
@@ -1,52 +0,0 @@
1
- package com.openfeint.memcached;
2
-
3
- import java.io.ByteArrayInputStream;
4
- import java.io.ByteArrayOutputStream;
5
- import java.io.IOException;
6
- import java.net.InetSocketAddress;
7
- import java.net.SocketAddress;
8
- import java.util.ArrayList;
9
- import java.util.List;
10
- import java.util.Map;
11
- import java.util.concurrent.ExecutionException;
12
- import net.spy.memcached.CachedData;
13
- import net.spy.memcached.MemcachedClient;
14
- import net.spy.memcached.transcoders.Transcoder;
15
- import org.jruby.Ruby;
16
- import org.jruby.RubyClass;
17
- import org.jruby.RubyException;
18
- import org.jruby.RubyHash;
19
- import org.jruby.RubyObject;
20
- import org.jruby.RubyString;
21
- import org.jruby.RubySymbol;
22
- import org.jruby.anno.JRubyClass;
23
- import org.jruby.anno.JRubyMethod;
24
- import org.jruby.exceptions.RaiseException;
25
- import org.jruby.runtime.ObjectAllocator;
26
- import org.jruby.runtime.ThreadContext;
27
- import org.jruby.runtime.builtin.IRubyObject;
28
- import org.jruby.runtime.load.Library;
29
- import org.jruby.runtime.marshal.MarshalStream;
30
- import org.jruby.runtime.marshal.UnmarshalStream;
31
-
32
- public class MemcachedLibrary implements Library {
33
- private Ruby ruby;
34
-
35
- public void load(final Ruby ruby, boolean bln) throws IOException {
36
- this.ruby = ruby;
37
-
38
- RubyClass memcached = ruby.defineClass("Memcached", ruby.getObject(), new ObjectAllocator() {
39
- public IRubyObject allocate(Ruby ruby, RubyClass rc) {
40
- return new Memcached(ruby, rc);
41
- }
42
- });
43
-
44
- memcached.defineAnnotatedMethods(Memcached.class);
45
-
46
- RubyClass runtimeError = ruby.getRuntimeError();
47
- RubyClass memcachedError = memcached.defineClassUnder("Error", runtimeError, runtimeError.getAllocator());
48
- memcached.defineClassUnder("NotFound", memcachedError, memcachedError.getAllocator());
49
- memcached.defineClassUnder("NotStored", memcachedError, memcachedError.getAllocator());
50
- memcached.defineClassUnder("NotSupport", memcachedError, memcachedError.getAllocator());
51
- }
52
- }