David Tinker
David Tinker

Reputation: 9634

How can I parameterize ehcache.xml with properties loaded at runtime?

I am using Ehcache + Hibernate + Spring with an ehcache.xml file. I would like to parameterize ehcache.xml with stuff from a properties file at runtime. Does anyone know an easy way to do this?

Upvotes: 5

Views: 1361

Answers (1)

skaffman
skaffman

Reputation: 403551

That depends on what sort of config you're talking about. ehcache.xml contains some global config (e.g. the location of the disk-overflow directory), as well as cache-specific config.

If you're talking about the latter, then you can use Spring's EhCache support (i.e. EhCacheFactoryBean and EhCacheManagerFactoryBean) to configure and manage EhCache instances.

If you're talking about the global config, though, I don't there's a way.

Upvotes: 3

Related Questions