[infinispan-dev] hotrod's RemoteCacheManager

Mircea Markus mircea.markus at jboss.com
Wed Mar 24 07:11:04 EDT 2010


I've checked in ongoing work of the hotrod client; it would be great to get some feedback on the public API, especially RemoteCache[1] and RemoteCacheManager[2].
For now RemoteCacheManager does not implement CacheManager interface, see email bellow.

[1] http://tinyurl.com/yhb793b
[2] http://tinyurl.com/yh6j2we

Cheers,
Mircea


On 23 Mar 2010, at 23:16, Mircea Markus wrote:

> Hi,
> 
> While presenting the hot rod client java API in Brno, we agreed to use a RemoteCacheManager that would implement CacheManager (similar to the way in which DefaultCacheManager implements CacheManager; it is used for clients from the same namespace).
> Looking at the CacheManager interface[1], most of the methods that do not make sense on the RemoteCacheManager: defineConfiguration, getClusterName, getAddress, isCoordinator, getStatus, getGlobalConfiguration, getDefaultConfiguration and getCacheNames. 
> The only two methods that really make sense are: getCache() and getCache(cacheName:String). So here are some thoughts I have about having RemoteCacheManager implementing CacheManager.
> 1. Approach 1 - throw exceptions for the unsupported methods. Not a very nice approach IMO, given the fact that most of the methods fall in this category, which would make the API a bit unusable
> 2.  Approach 2 - do not extend it. This would result in a clearer API
> 3. Approach 2 - Extract the  two getCache methods in an super interface (CacheHolder, CacheRepository, ??) and have both CacheManager and RemoteCacheManager implement it - this one I like the most as it encourages reusability and keeps the API clean.
> 
> Thoughts?
> 
> Cheers,
> Mircea
> 
> [1] http://anonsvn.jboss.org/repos/infinispan/trunk/core/src/main/java/org/infinispan/manager/CacheManager.java
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20100324/24155d49/attachment-0002.html 


More information about the infinispan-dev mailing list