torquebox-cache 2.0.0.cr1-java → 2.0.0-java
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/lib/cache.rb +3 -2
- data/lib/torquebox-cache.jar +0 -0
- data/lib/torquebox-cache.rb +2 -2
- data/spec/torque_box_store_spec.rb +4 -4
- metadata +15 -15
data/lib/cache.rb
CHANGED
@@ -98,6 +98,7 @@ module TorqueBox
|
|
98
98
|
@options = opts
|
99
99
|
options[:transaction_mode] = :transactional unless options.has_key?( :transaction_mode )
|
100
100
|
options[:locking_mode] ||= :optimistic if (transactional? && !options.has_key?( :locking_mode ))
|
101
|
+
options[:sync] = true if options[:sync].nil?
|
101
102
|
cache
|
102
103
|
end
|
103
104
|
|
@@ -112,7 +113,7 @@ module TorqueBox
|
|
112
113
|
def clustering_mode
|
113
114
|
replicated = [:r, :repl, :replicated, :replication].include? options[:mode]
|
114
115
|
distributed = [:d, :dist, :distributed, :distribution].include? options[:mode]
|
115
|
-
sync =
|
116
|
+
sync = options[:sync]
|
116
117
|
case
|
117
118
|
when replicated
|
118
119
|
sync ? CacheMode::REPL_SYNC : CacheMode::REPL_ASYNC
|
@@ -302,7 +303,7 @@ module TorqueBox
|
|
302
303
|
cache = manager.get_cache(name)
|
303
304
|
base_config = cache.configuration
|
304
305
|
unless base_config.cache_mode == mode
|
305
|
-
log( "Reconfiguring Infinispan cache #{name} from #{
|
306
|
+
log( "Reconfiguring Infinispan cache #{name} from #{base_config.cache_mode} to #{mode}" )
|
306
307
|
cache.stop
|
307
308
|
base_config.cache_mode = mode
|
308
309
|
config = base_config.fluent
|
data/lib/torquebox-cache.jar
CHANGED
Binary file
|
data/lib/torquebox-cache.rb
CHANGED
@@ -192,14 +192,14 @@ describe ActiveSupport::Cache::TorqueBoxStore do
|
|
192
192
|
describe "clustering" do
|
193
193
|
|
194
194
|
it "should default to invalidation mode" do
|
195
|
-
@cache.clustering_mode.should == CacheMode::
|
196
|
-
TorqueBoxStore.new(:mode => :unknown).clustering_mode.should == CacheMode::
|
195
|
+
@cache.clustering_mode.should == CacheMode::INVALIDATION_SYNC
|
196
|
+
TorqueBoxStore.new(:mode => :unknown).clustering_mode.should == CacheMode::INVALIDATION_SYNC
|
197
197
|
end
|
198
198
|
|
199
199
|
[:repl, :dist, :invalidation].each do |mode|
|
200
200
|
it "should be configurable in #{mode} mode" do
|
201
|
-
TorqueBoxStore.new(:mode => mode).clustering_mode.to_s.should == "#{mode.to_s.upcase}
|
202
|
-
TorqueBoxStore.new(:mode => mode, :sync =>
|
201
|
+
TorqueBoxStore.new(:mode => mode).clustering_mode.to_s.should == "#{mode.to_s.upcase}_SYNC"
|
202
|
+
TorqueBoxStore.new(:name => 'async', :mode => mode, :sync => false).clustering_mode.to_s.should == "#{mode.to_s.upcase}_ASYNC"
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torquebox-cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 2.0.0
|
4
|
+
prerelease:
|
5
|
+
version: 2.0.0
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- The TorqueBox Team
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-31 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - "="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.0.0
|
45
|
+
version: 2.0.0
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id003
|
48
48
|
- !ruby/object:Gem::Dependency
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - "="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 2.0.0
|
56
|
+
version: 2.0.0
|
57
57
|
type: :runtime
|
58
58
|
version_requirements: *id004
|
59
59
|
- !ruby/object:Gem::Dependency
|
@@ -113,21 +113,21 @@ files:
|
|
113
113
|
- licenses/lgpl-2.1.txt
|
114
114
|
- lib/torquebox-cache.jar
|
115
115
|
- lib/torquebox-cache.rb
|
116
|
+
- lib/cache.rb
|
116
117
|
- lib/dm-infinispan-adapter.rb
|
117
118
|
- lib/cache_listener.rb
|
118
119
|
- lib/gem_hook.rb
|
119
|
-
- lib/cache.rb
|
120
|
-
- lib/datamapper/search.rb
|
121
120
|
- lib/datamapper/dm-infinispan-adapter.rb
|
122
121
|
- lib/datamapper/model.rb
|
122
|
+
- lib/datamapper/search.rb
|
123
123
|
- lib/active_support/cache/torque_box_store.rb
|
124
|
-
- spec/
|
124
|
+
- spec/cache_listener_spec.rb
|
125
125
|
- spec/spec_helper.rb
|
126
126
|
- spec/spec.opts
|
127
|
-
- spec/
|
128
|
-
- spec/cache_spec.rb
|
127
|
+
- spec/torque_box_store_spec.rb
|
129
128
|
- spec/dm-infinispan-adapter_spec.rb
|
130
|
-
|
129
|
+
- spec/cache_spec.rb
|
130
|
+
homepage: http://torquebox.org/
|
131
131
|
licenses:
|
132
132
|
- lgpl
|
133
133
|
post_install_message:
|
@@ -144,9 +144,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
144
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
145
|
none: false
|
146
146
|
requirements:
|
147
|
-
- - "
|
147
|
+
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
149
|
+
version: "0"
|
150
150
|
requirements: []
|
151
151
|
|
152
152
|
rubyforge_project:
|
@@ -155,7 +155,7 @@ signing_key:
|
|
155
155
|
specification_version: 3
|
156
156
|
summary: TorqueBox Cache Gem
|
157
157
|
test_files:
|
158
|
-
- spec/torque_box_store_spec.rb
|
159
158
|
- spec/cache_listener_spec.rb
|
160
|
-
- spec/
|
159
|
+
- spec/torque_box_store_spec.rb
|
161
160
|
- spec/dm-infinispan-adapter_spec.rb
|
161
|
+
- spec/cache_spec.rb
|