-
1. Create Cache at runtime?
jombo Mar 8, 2011 12:07 AM (in response to amalrajvinoth)1 of 1 people found this helpfulwhen u are using the api "cachemanager.getCache(name)" while the name is not exist in the namecache configration, Infinispan will create a cache according with the default cache configration
-
2. Create Cache at runtime?
amalrajvinoth Mar 8, 2011 12:14 AM (in response to jombo)By mistake, if we provide wrong cache name in getCache("wrong name"), then it should produce exception right?
-
3. Create Cache at runtime?
jombo Mar 8, 2011 12:52 AM (in response to amalrajvinoth)what does the "wrong name" mean?
a exist namedcache that has been start or create? or a unexist namedcache?
if mean a existed cache, it won' t throw a exception but return the exist cache that has been created
-
4. Create Cache at runtime?
amalrajvinoth Mar 8, 2011 1:30 AM (in response to jombo)I mean, i want to create cache at runtime programatically?
is there any provision to do that?
-
5. Create Cache at runtime?
brenuart Mar 8, 2011 7:01 AM (in response to amalrajvinoth)1 of 1 people found this helpfulCheckout the online documentation, javadoc and put your hands in the dirt.
That's the best advice I could give you.
And, calling CacheManager.getCache(name) will create a new cache with name "name" if it does not exist yet.
If the configuration you gave to the CacheManager when you first created it contains elements for this named-cache, they will be used. Otherwise, this new cache will inherit the default configuration.
-
6. Create Cache at runtime?
galder.zamarreno Mar 11, 2011 5:44 AM (in response to brenuart)If you want such an strict behaivour, you can always call EmbeddedCacheManager.getCacheNames and see if the cache you wanna get is there or not and act accordingly. That's what the Infinispan servers do to make sure you only to talk to predefined caches.