On 25 Feb 2011, at 17:02, Galder ZamarreƱo wrote:
Hi all,
I'm working on
https://issues.jboss.org/browse/ISPN-905 and just wanted to explain
the interface where these methods will be added and why in case anyone differs:
I had initially thought of adding them to CacheContainer but doing that implies that they
have a meaning for the RemoteCacheManager.
So, could a remote client call removeCache("x"), taking in account that it does
both remove the contents of the cache and any cache loader attached to it, plus stops the
cache? Remote clients can currently clear caches, but cannot stop them, so it would not
make sense to do this right now given the current remote client capabilities. Also, we
agreed not to allow remote clients to stop things in order to reduce potential security
issues,
remove() should only be in Embedded.
On top of the logical argument, there's a problem of API incompatibility with
RemoteCacheManager. If we'd want to add getCache(String, Boolean) to CacheContainer,
this would clash with RemoteCacheManager's:
Again, this too should be in Embedded. RemoteCaches have no ability to deal with
lifecycle.
public <K, V> RemoteCache<K, V> getCache(boolean
forceReturnValue);
So, that would have forced us to provide a different name in CacheContainer to avoid
clashing with this method, and that in turn would have resulted in breaking simmetry with
other similar APIs such as AtomicMapLookup API where we define:
public static <MK, K, V> AtomicMap<K, V> getAtomicMap(Cache<MK, ?>
cache, MK key, boolean createIfAbsent);
Bottom line, the method suggested by
https://issues.jboss.org/browse/ISPN-905 will be
included in EmbeddedCacheManager.
Yep. :-)
If anyone has any different opinions, post reply :)
Cheers,
--
Galder ZamarreƱo
Sr. Software Engineer
Infinispan, JBoss Cache
_______________________________________________
infinispan-dev mailing list
infinispan-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--
Manik Surtani
manik(a)jboss.org
twitter.com/maniksurtani
Lead, Infinispan
http://www.infinispan.org