Skip to content

Commit

Permalink
added an ehcache_manual_rmi.yml as an example of manual
Browse files Browse the repository at this point in the history
discovery, rmi cache listening, asynch rmi bootstrapping.
a random yml, but may as well share :)
  • Loading branch information
dylanz committed Aug 1, 2008
1 parent e1d2818 commit dc9699e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/ehcache/config.rb
Expand Up @@ -50,7 +50,6 @@ def process(config, options)
@configuration.add_disk_store(@disk)
@configuration.add_cache_manager_peer_provider_factory(@peer_provider)
@configuration.add_cache_manager_peer_listener_factory(@peer_listener)
@configuration.add_cache_manager_event_listener_factory(@event_listener)
@configuration
end

Expand All @@ -74,9 +73,16 @@ def create_cache_configuration(data)
# factories, loader factories, etc. TODO: clean this up, and add
# support for adding other factories in a cleaner fashion.
if v.is_a?(Hash)
event_factory = Ehcache::Java::CacheConfiguration::CacheEventListenerFactoryConfiguration.new(config)
v.each { |k,v| event_factory.send("set_#{k.to_s}",v) }
config.add_cache_event_listener_factory(event_factory)
case k
when "event_listener":
event_factory = Ehcache::Java::CacheConfiguration::CacheEventListenerFactoryConfiguration.new(config)
v.each { |k,v| event_factory.send("set_#{k.to_s}",v) }
config.add_cache_event_listener_factory(event_factory)
when "bootstrap_loader":
bootstrap_loader = Ehcache::Java::CacheConfiguration::BootstrapCacheLoaderFactoryConfiguration.new(config)
v.each { |k,v| bootstrap_loader.send("set_#{k.to_s}",v) }
config.add_bootstrap_cache_loader_factory(bootstrap_loader)
end
else
config.send("set_#{k.to_s}",v)
end
Expand Down

0 comments on commit dc9699e

Please sign in to comment.