Class: ActiveSupport::Cache::HazelcastCacheStore
- Inherits:
-
Store
- Object
- Store
- ActiveSupport::Cache::HazelcastCacheStore
- Defined in:
- lib/jruby-hazelcast-store.rb
Defined Under Namespace
Classes: CacheException
Instance Method Summary collapse
- #clear ⇒ Object
- #delete_entry(key, options = nil) ⇒ Object
- #delete_matched(matcher, options = nil) ⇒ Object
- #exist?(key, options = nil) ⇒ Boolean
-
#initialize(options = {}) ⇒ HazelcastCacheStore
constructor
A new instance of HazelcastCacheStore.
- #keys ⇒ Object
- #read_entry(key, options = nil) ⇒ Object
- #write_entry(key, value, options = nil) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ HazelcastCacheStore
Returns a new instance of HazelcastCacheStore.
13 14 15 16 17 18 |
# File 'lib/jruby-hazelcast-store.rb', line 13 def initialize( = {}) @cache = HazelcastCacheClient.instance rescue CacheException => e logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.}") end |
Instance Method Details
#clear ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/jruby-hazelcast-store.rb', line 57 def clear @data.clear true rescue CacheException => e logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.}") end |
#delete_entry(key, options = nil) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/jruby-hazelcast-store.rb', line 35 def delete_entry(key, = nil) @data.evict(key) rescue CacheException => e logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.}") end |
#delete_matched(matcher, options = nil) ⇒ Object
53 54 55 |
# File 'lib/jruby-hazelcast-store.rb', line 53 def delete_matched(matcher, = nil) raise "Not supported by HazelcastCacheClient" end |
#exist?(key, options = nil) ⇒ Boolean
46 47 48 49 50 51 |
# File 'lib/jruby-hazelcast-store.rb', line 46 def exist?(key, = nil) @data.exist?(key) rescue CacheException => e logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.}") end |
#keys ⇒ Object
42 43 44 |
# File 'lib/jruby-hazelcast-store.rb', line 42 def keys raise "Not supported by HazelcastCacheClient" end |
#read_entry(key, options = nil) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/jruby-hazelcast-store.rb', line 20 def read_entry(key, = nil) @cache.get(key) rescue CacheException => e logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.}") end |
#write_entry(key, value, options = nil) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/jruby-hazelcast-store.rb', line 27 def write_entry(key, value, = nil) @data.put(key, value, ) true rescue CacheException => e logger.error("HazelcastCacheStore Creation Error (#{e}): #{e.}") end |