[infinispan-dev] Placement for ISPN-905 API

Galder Zamarreño galder at redhat.com
Fri Feb 25 12:02:21 EST 2011


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,

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: 

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.

If anyone has any different opinions, post reply :)

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




More information about the infinispan-dev mailing list