[infinispan-dev] EmbeddedCacheManager needs getRunningCacheNames, doesn't it?

Galder Zamarreño galder.zamarreno at redhat.com
Fri Mar 11 11:22:05 EST 2011


Guys,

This (http://community.jboss.org/message/592436#592436) thread brought up an interesting limitation of our CacheManager API.

Let's say you wanna remove all caches within a cache manager, and by remote I mean not only clear the in memory contents, but also the cache store stuff (so, similar to what is suggested in https://issues.jboss.org/browse/ISPN-905 but at the cache manager level)

I don't think this is such a common use case to require a removeAllCaches() at the CacheManager level (or maybe it does?). One would imagine that given a removeCache(name), you should be able to get all cache names and loop through them. However, there's no such method. We have getCacheNames() but that's only limited to the cache names that have predefined either via XML, as <namedCache>, or programmatically via defineConfiguration. Any other cache that might have been started and whose name was not predefined would be a running a cache based on the default config. However, there's no way to find out about all these caches.

So, rather than providing removeAllCaches(), it might more interesting to provide: getRunningCacheNames() which would be getCacheNames() + (undefined caches that have been started which are based on default config). Or maybe we wanna provide both!

Clearly, something for 5.0.

Thoughts?
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the infinispan-dev mailing list