<cache-template name="myDefaults">
<key-type>java.lang.Long</key-type>
<value-type>java.lang.String</value-type>
<heap size="200" unit="entries"/>
</cache-template>
<cache alias="simpleCache" uses-template="myDefaults" /> cacheManager.createCache("simpleCache", ...);In my project, the cache name is determined at run time, meaning I cannot code it in the XML file.
I have two questions:
1. Is there a way to configure a default cache configuration?
2. How to create a Cache instance with dynamic name, but based on default configuration from #1 ?
Thanks
igor
--
You received this message because you are subscribed to the Google Groups "ehcache-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.
To post to this group, send email to ehcach...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/5eb91dde-3b0a-441b-9646-266437759aaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/beab6166-96ab-46b6-af86-be5761e1d29f%40googlegroups.com.
Hey Igor,I'm not sure where the issue lies. In Ehcache 2.x you used "default" caches as the basic template for all the Cache instances your library creates, y?
If so, you actually did require the user to configure that "defaultCache" in the ehcache.xml, y?
Since there is no "defaultCache" in the 3.x line anymore, you just need to either:
- Ask the user to configure a given cache-template in his ehcache.xml
- Have the name of the template to use, dynamically configurable at your library's level
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/8ac14724-8af7-44d1-a594-4553e96b01d8%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/06c0a8aa-7e58-4ca7-8882-8779e40094a0%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/a7492e40-1fa7-462b-8621-ad1bc5ece49c%40googlegroups.com.