jruby-hazelcast-store 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +1 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/jruby-hazelcast-store.gemspec +44 -0
- data/lib/jruby-hazelcast-store.rb +73 -0
- metadata +77 -0
data/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Rails cache interface to Hazelcast cache cluster, using the jruby-hazelcast gem
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
begin
|
2
|
+
require 'jeweler'
|
3
|
+
Jeweler::Tasks.new do |gemspec|
|
4
|
+
gemspec.name = "jruby-hazelcast-store"
|
5
|
+
gemspec.summary = "jruby interface to Rails Cache for Hazelcast"
|
6
|
+
gemspec.description = ""
|
7
|
+
gemspec.email = "adam@dberg.org"
|
8
|
+
gemspec.homepage = "http://github.com/denen99/jruby-hazelcast-store"
|
9
|
+
gemspec.authors = ["Adam Denenberg"]
|
10
|
+
gemspec.add_dependency 'jruby-hazelcast'
|
11
|
+
|
12
|
+
end
|
13
|
+
Jeweler::GemcutterTasks.new
|
14
|
+
rescue LoadError
|
15
|
+
puts "Jeweler not available. Install it with: gem install jeweler"
|
16
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{jruby-hazelcast-store}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Adam Denenberg"]
|
12
|
+
s.date = %q{2010-06-25}
|
13
|
+
s.description = %q{}
|
14
|
+
s.email = %q{adam@dberg.org}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
"README",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION",
|
22
|
+
"jruby-hazelcast-store.gemspec",
|
23
|
+
"lib/jruby-hazelcast-store.rb"
|
24
|
+
]
|
25
|
+
s.homepage = %q{http://github.com/denen99/jruby-hazelcast-store}
|
26
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
27
|
+
s.require_paths = ["lib"]
|
28
|
+
s.rubygems_version = %q{1.3.6}
|
29
|
+
s.summary = %q{jruby interface to Rails Cache for Hazelcast}
|
30
|
+
|
31
|
+
if s.respond_to? :specification_version then
|
32
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
33
|
+
s.specification_version = 3
|
34
|
+
|
35
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
36
|
+
s.add_runtime_dependency(%q<jruby-hazelcast>, [">= 0"])
|
37
|
+
else
|
38
|
+
s.add_dependency(%q<jruby-hazelcast>, [">= 0"])
|
39
|
+
end
|
40
|
+
else
|
41
|
+
s.add_dependency(%q<jruby-hazelcast>, [">= 0"])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'java'
|
2
|
+
require 'jruby-hazelcast'
|
3
|
+
require 'active_support'
|
4
|
+
|
5
|
+
module ActiveSupport
|
6
|
+
|
7
|
+
module Cache
|
8
|
+
|
9
|
+
class HazelcastCacheStore < Store
|
10
|
+
|
11
|
+
class CacheException < StandardError; end
|
12
|
+
|
13
|
+
def initialize(options = {})
|
14
|
+
@cache = HazelcastCacheClient.instance
|
15
|
+
rescue CacheException => e
|
16
|
+
logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.message}")
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
def read(key, options = nil)
|
21
|
+
super
|
22
|
+
@cache.get(key)
|
23
|
+
rescue CacheException => e
|
24
|
+
logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.message}")
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
def write(key, value, options = nil)
|
29
|
+
super
|
30
|
+
@data.put(key, value, options)
|
31
|
+
true
|
32
|
+
rescue CacheException => e
|
33
|
+
logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.message}")
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def delete(key, options = nil)
|
38
|
+
super
|
39
|
+
@data.evict(key)
|
40
|
+
rescue CacheException => e
|
41
|
+
logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.message}")
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
def keys
|
46
|
+
super
|
47
|
+
raise "Not supported by HazelcastCacheClient"
|
48
|
+
end
|
49
|
+
|
50
|
+
def exist?(key, options = nil)
|
51
|
+
@data.exist?(key)
|
52
|
+
rescue CacheException => e
|
53
|
+
logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.message}")
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
def delete_matched(matcher, options = nil)
|
58
|
+
super
|
59
|
+
raise "Not supported by HazelcastCacheClient"
|
60
|
+
end
|
61
|
+
|
62
|
+
def clear
|
63
|
+
@data.clear
|
64
|
+
true
|
65
|
+
rescue CacheException => e
|
66
|
+
logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.message}")
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
metadata
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jruby-hazelcast-store
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Adam Denenberg
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-06-25 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: jruby-hazelcast
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
32
|
+
description: ""
|
33
|
+
email: adam@dberg.org
|
34
|
+
executables: []
|
35
|
+
|
36
|
+
extensions: []
|
37
|
+
|
38
|
+
extra_rdoc_files:
|
39
|
+
- README
|
40
|
+
files:
|
41
|
+
- README
|
42
|
+
- Rakefile
|
43
|
+
- VERSION
|
44
|
+
- jruby-hazelcast-store.gemspec
|
45
|
+
- lib/jruby-hazelcast-store.rb
|
46
|
+
has_rdoc: true
|
47
|
+
homepage: http://github.com/denen99/jruby-hazelcast-store
|
48
|
+
licenses: []
|
49
|
+
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options:
|
52
|
+
- --charset=UTF-8
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
version: "0"
|
69
|
+
requirements: []
|
70
|
+
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 1.3.6
|
73
|
+
signing_key:
|
74
|
+
specification_version: 3
|
75
|
+
summary: jruby interface to Rails Cache for Hazelcast
|
76
|
+
test_files: []
|
77
|
+
|