10 Replies Latest reply on May 14, 2010 1:41 PM by Mircea Markus

    RemoteCacheManager doesn't implement CacheManager?

    Supin Ko Newbie

      Hello,

       

      I just started investigating using Infinispan as a data grid and ran into this puzzlement. I have a setup where we may or may not have a HotRod cluster running in dev. When it is available, I wanted to use RemoteCacheManager, but if not, I wanted to use DefaultCacheManager. My first instinct was to have some logic like:

       

      CacheManager cacheMgr;

      if (usingRemoteGrid) {

        cacheMgr = new RemoteCacheManager();

      } else {

        cacheMgr = new DefaultCacheManager();

      }

       

      ...

      void shutdown() {

        cacheMgr.stop();

      }

       

      Surprisingly, this won't compile because RemoteCacheManager doesn't implement CacheManager. Sure, I could use CacheContainer, but then I wouldn't be able to call cacheMgr.stop() because that's in the Lifecycle interface. Is there some compelling reason why RemoteCacheManager can't implement CacheManager?

       

      Thanks,

      Supin